If you want to see the hibernate generated sql statements on console, what should we do?



If you want to see the hibernate generated sql statements on console, what should we do?..

Answer / Munazir Hussain

To see the Hibernate generated SQL statements on the console, you can enable logging by setting the appropriate log level in your configuration file or programmatically. For example, you can use the following code to enable SQL logging: LogFactory.getFactory().setAttribute("org.hibernate.SQL", Level.DEBUG);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

What is the difference between jdbc and hibernate?

1 Answers  


How do you implement one to one relationship in hibernate with xml mapping?

1 Answers  


What is the purpose of mapping?

1 Answers  


What is hibernate mapping file?

1 Answers  


What is meaning of cascade in hibernate?

1 Answers  


How to retrieve data from database using hibernate criteria?

1 Answers  


What is use of hibernate session merge() call?

1 Answers  


What is the difference between hibernate save () saveorupdate () and persist () methods?

1 Answers  


What is unidirectional and bidirectional?

1 Answers  


Mention some of the advantages of using orm over jdbc.

1 Answers  


What are persistent objects hibernate?

1 Answers  


What is flush in hibernate?

1 Answers  


Categories