Does someone have pretty_print function for print SQL query in java?
given string like:
SELECT person_table.name FROM person_table JOIN person_perso
You can take a look at org.apache.openjpa.lib.jdbc.SQLFormatter.
If you work with Hibernate try org.hibernate.jdbc.util.FormatStyle.BASIC.getFormatter().format(yourNonFormattedSqlQueryString);
org.hibernate.jdbc.util.FormatStyle.BASIC.getFormatter().format(yourNonFormattedSqlQueryString);