Overview
Sometimes you may want to debug your SQL queries that are generated by Hibernate. In the post, we are going to discuss how to show SQL statements and parameters with Hibernate.
Enable ability to show SQL statements and parameters
Simple add the following code to the application.properties file:
1
2
3
4
5
# Show sql statement
logging.level.org.hibernate.SQL=debug
# Show sql parameters
logging.level.org.hibernate.type.descriptor.sql=trace
Conclusion
We have discussed how to show SQL statements and parameters with Hibernate.
-
Previous
How to enable partial compilation in IDEA -
Next
How to call a procedure in a database with spring boot