2 Replies Latest reply on Apr 5, 2006 4:25 AM by jaboj

    SQL Trace / debug

    jaboj

      HI,

      Is there a way to trace / debug every SQL statement executed by the EJB container against the database. I would like to debug the statements to a file or to the concole.

      We're using JBOSS 4.0.3 SP1

        • 1. Re: SQL Trace / debug
          mwoelke

          There is an option for hibernate to output all sql.

          insert this to the properties of the persistence-unit you want to log all statements from.

           <property name="hibernate.show_sql" value="true"/>
           <property name="hibernate.format_sql" value="true"/>
           <property name="hibernate.use_sql_comments" value="true"/>
          


          Of course the last 2 lines arent really necessary.

          Regards, Milan Wölke

          • 2. Re: SQL Trace / debug
            jaboj

            Thank you very much. Exactly what I needed....