Implementation Guide for Oracle Self-Service E-Billing > Customizing Oracle Self-Service E-Billing > Debugging Oracle Self-Service E-Billing >

Displaying SQL Statements


One of the most useful debug features is to display the SQL statements issued to the database.

To view the Hibernate SQL statements

  1. Open the persistence.xma.xml file for editing. This file is found in the EDX_HOME/xma/config/modules directory, where EDX_HOME is the directory where you installed Oracle Self-Service E-Billing.
  2. Edit the hibernate.show.sql property, changing the value from false to true:

    <prop key=hibernate.show_sql>false</prop>

  3. To be able to view the SQL binding values as well (the hibernate.show_sql property allows you to view the SQL statements only), edit the log4j files (log4j.xml, log4jcc.xml, and log4jccenter.xml) which are found in the EDX_HOME/config directory. Change the log level for these two loggers to debug:

    <logger name="org.hibernate.SQL" additivity="false">

    <level value="TRACE"/>

    <appender-ref ref="cba-log"/>

    </logger>

    <logger name="net.sf.hibernate.type" additivity="false">

    <level value="error"/>

    <appender-ref ref="cba-log"/>

    </logger>

  4. These configurations apply to Hibernate-based DB access. One exception is reporting-related SQL statements, which are issued without using Hibernate. To view the report SQL statements and their binding values, add a Java -D option:

    java -Ddatasource.debug=true

Implementation Guide for Oracle Self-Service E-Billing Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices.