Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Instead of really verbose and not intuitive hibernate SQL logging you can use a Pass through Java JDBC driver that can log <code>SQL</code> and/or <code>JDBC calls</code> for other JDBC drivers. </p> <p>Pass through JDBC driver have the advantage that the logged output, for prepared statements, have the bind arguments automatically inserted into the SQL output. This greatly Improves readability, debugging and the size of the log for many cases. SQL timing information can be generated when needed. </p> <p>With hibernate's logging you have logging similar to :</p> <pre><code> select bs0_.A_REF as A2_7_0_ from B bs0_ where bs0_.other = 0 and bs0_.A_REF=? TRACE 2011-08- 03 00:30:45,317 binding '123' to parameter: 1 </code></pre> <p>With big query with a lot of parameter it can be painfull to replace all the bind parameter before executing the query manually on the database.</p> <p>With Pass through JDBC driver you have logging similar to :</p> <pre><code>select bs0_.A_REF as A2_7_0_ from B bs0_ where bs0_.other = 0 and bs0_.A_REF=123 </code></pre> <p>All the bind parameter are resolved and you just have to copy paste it to execute the query on the database.</p> <p>You can check <a href="http://code.google.com/p/log4jdbc/" rel="nofollow">log4jdbc</a> as good pass through JDBC driver.<br> To shut off hibernate logging be sure to set to false the <code>hibernate.show_sql</code> properties in the config file and all SQL related logger. See the <a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-logging" rel="nofollow">Logging Configuration</a> section of the reference documentation</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload