General SQL Parser (GSP) is a quite feature rich SQL parser (to the extent that I have played with it) that allows for modifying SQL statements in a robust way by altering the parse tree itself. Furthermore, it supports SQL flavors for most popular databases. However, a big minus with GSP is that it is horribly, simply horribly, documented: the javadoc's consist mostly of the raw method and property names (with almost no comments), there are really no documentation that outlines the core functionality and the meaning of most important properties and methods; and it seems like they have just exposed everything as public members, making the API very hard to grasp by looking at it. The only documentation is a bunch of practical examples from which you have to reverse-engineer the meaning of the API calls yourself.
I do not like producing production critical software with a library like that. So due to the above, I would prefer using another parser, but have unfortunately failed to find any alternatives (for java) with similar functionality and support for multiple SQL flavors.
Are there any comparable (!) alternatives to GSP for java out there?
I'm James from gudu software(company that developed General SQL Parser). Due to the complexity of SQL language of various databases such as Oracle, SQL Server, DB2, MySQL, Teradata, PostgreSQL, the SQL Parser we created to support those databases was a little bit complicated as well.
I have to admit that the document of General SQL Parser is really poor, Maybe we should put more effort on the document rather than SQL library itself.
Fortunately, we have created a rich set of demos to help people getting started quickly.
If are still interested in using General SQL Parser, please kindly let me know(I can be reached via info@sqlparser.com). We are happy to help.
Have you had a look at JsqlParser? I don't know how it compares feature wise, but I've seen it used in production code and it works extremely well.