tags:

views:

46

answers:

1

Hi all,

In my hibernate config show_sql property is 'true' and since i am not using log4j API of logging, by default hibernate was showing queries with '?' marks in the tomcat console.

In my case i need to print the complete sql query with parameter values which was executed by hibernate into logs, but i am not using log4j API for logging to configure the debug level for org.hibernate.SQL and org.hibernate.type.

For logging we are manually writing the content into the file, so in this situation can anybody tell me how can i get the hibernate queries into logs.

A: 

In my case i need to print the complete sql query with parameter values which was executed by hibernate into logs, but i am not using log4j API for logging to configure the debug level for org.hibernate.SQL and org.hibernate.type

Whether you're using a logging framework or not, Hibernate will output question marks when logging prepared statements.

If you want to print the "real query" with the bound values, you'll have to use a JDBC Proxy driver like P6Spy (doesn't move anymore) or log4jdbc.

Pascal Thivent
Even , how can print those sql statements with question marks into our predefined logs?
Pawan