http://www.quora.com/What-is-the-best-free-commercial-SQL-parser-written-in-Java
I had looked at a lot of free/commercial SQL parsers myself a few months back. There was an interesting discussion at StackOverFlow(http://stac
- Commercial :The best SQLParser which I found was SQLParser( http://www.sqlparser.com/ ) . It is not free but is quite powerful.
- Open Source but unfriendly license for Commercial Products: There were a few open source projects , ZQL http://zql.sourceforge.ne
t/ ) , JSQLPARSER http://jsqlparser.sourceforge.net/ . These were fine for simple queries but I wouldn't recommend them for complex queries. Another thing with these was that they are quite old projects with no active development in a long while. - Create Your Own : I used this solution to create my own SQLParser using ANTLR(http://www.antlr.or
g ). It has specific parsers for PL/SQL as well as T/SQL. Almost all the ORM frameworks use ANTLR. You can find the grammar easily but it would require coding efforts.
Have a look at JBoss Teiid(http://www.jboss.or