Hibernate / Hibernate interview questions II
How do I print a query with parameter values when using Hibernate?
Enable logging for the categories, org.hibernate.SQL and org.hibernate.type.
# logs SQL statements log4j.logger.org.hibernate.SQL=debug # Logs JDBC parameters passed to a query log4j.logger.org.hibernate.type=trace
The property 'org.hibernate.SQL' is equivalent to hibernate.show_sql=true, and the second prints the bound parameters.
More Related questions...