SQL parser library for Java [closed]
ANTLR3 has an ANSI SQL grammar available. You can use that to create your own parser.
ANTLR4 has a SQL grammar.
- JSqlParser
- Presto's parser is written using ANTLR4 and has its own immutable AST classes that are built from the parser. The AST has a visitor and pretty printer.
Parser
If you need a parser there should be a parser in the code base of Apache Derby.
Dealing with vendor-specific SQL
You may want to look at the .native() method on the jdbc Connection object which you can pass it vendor neutral queries that will get postprocessed into vendor specific queries.