1 Reply Latest reply on Nov 23, 2014 1:13 PM by masummymesingh

    enable JDBC tracing on the JBOSS server

    jaimediegues

      Does anyine know how to enable JDBC tracing on the JBOSS server or any other way to trace the SQL statements issued from there?

       

       

      so after 3 months no one post anything related and I had more then 100 visits I decided put the information here.

       

       

      <property name="show_sql">true</property>

      Then you will see the SQL statement query as shown below (the SQL statement values are missing, instead ???? as an example below ).

      Hibernate: INSERT INTO naresh.job_submissions (JOBID, CANDIDATEID, SUBMISSION_DATE)

      VALUES (?, ?, ?)

       

      It just isn’t enough for debugging in some cases, the Hibernate SQL parameter values are missing. To get those values we need to have few more configurations.

      Set the level for org.hibernate.type to TRACE as follows in jboss-log4j.xml incase if you configure your log4j in jboss.

      <param name="Threshold" value="TRACE"/>

      <category name="org.hibernate.type">

      <priority value="TRACE"/>

      </category>


      If you have a separate log4j.properties then you just need to configure like shown below.

      <param name="Threshold" value="TRACE"/>

       

       

      Hope it helps