java-pretty print sql query

后端 未结 2 1186
暗喜
暗喜 2021-01-18 00:36

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

相关标签:
2条回答
  • 2021-01-18 01:33

    You can take a look at org.apache.openjpa.lib.jdbc.SQLFormatter.

    0 讨论(0)
  • 2021-01-18 01:34

    If you work with Hibernate try org.hibernate.jdbc.util.FormatStyle.BASIC.getFormatter().format(yourNonFormattedSqlQueryString);

    0 讨论(0)
提交回复
热议问题