Wednesday, October 26, 2011

Hibernate show sql with parameters


#log hibernate prepared statements/SQL queries 
#(equivalent to setting 'hibernate.show_sql' to 'true')
log4j.logger.org.hibernate.SQL=debug

# log JDBC bind parameter runtime arguments
log4j.logger.org.hibernate.type=trace

To format sql output put this line in hibernate configuration file:
hibernate.format_sql

No comments:

Post a Comment