How do I show SQL with Play Framework?

前端 未结 2 1257
既然无缘
既然无缘 2020-12-30 22:42

I have a Play app that uses a database, and for debugging purposes I want to show the SQL that JPA uses. How can I do this?

2条回答
  •  清酒与你
    2020-12-30 22:58

    In application.conf, you can turn showing SQL on uncommenting jpa.debugSQL=true. This will give you the prepared statement queries with question marks in them. Also, Play uses Hibernate, so you can also use Hibernate properties. These can be written in application.conf directly or in a separate hibernate.properties file residing in the conf folder of your Play application.

提交回复
热议问题