I am looking for a Java open source beautifier or reformatter for SQL that I can use to clean up DDL statements that I am generating with openArchitectureWare.
Nothing in the answer to "Online Code Beautifier And Formatter" is of use to me and I have not been able to get Simple SQL Formatter to work for me.
Perhaps jsqlparser will work for you.
Not as easy to find as you might think, as there are a fair few defunct projects out there. In fact i failed to find it so ended up doing my own thing (based on the h2 parser - you can contact me if all else fails). As a consequence i do not know if it has a beautifier, but writing one on top should be straight forward enough.
Its based on a grammar and JavaCC, so probably a better option than reinventing this wheel with antlr in any event. You may find if you need to support various dialects of sql in complex statements that any approach based on a grammar will fail you.
Would this work - SQL Formatter.