Using P6SPY with OC4J
P6Spy is an open source utility that you can use to log the SQL statements generated by J2EE containers. For details about about P6SPY please look at http://www.p6spy.com/. This blog entry will contain the instructions to configure P6SPY with OC4J 9.0.4.
Install P6SPY files in OC4J environment
Copy the p6spy.jar and spy.properties files to %OC4J_HOME%/j2ee/home/applib directory
Configure data-sources.xml
Edit the file %OC4J_HOME%/j2ee/home/config/datasources.xml for the DataSource that is being used by your application and replace the line:
connection-driver="oracle.jdbc.driver.OracleDriver"
with
connection-driver="com.p6spy.engine.spy.P6SpyDriver"
Configure spy.properties
Edit the file %OC4J_HOME%/j2ee/home/applib/spy.properties and uncomment the line
# realdriver=oracle.jdbc.driver.OracleDriver
to be:
realdriver=oracle.jdbc.driver.OracleDriver
Restart OC4J
Restart OC4J and run your J2EE application that contains CMP entity beans and the SQL statements generated by OC4J will be captured and logged in %OC4J_HOME%/j2ee/home/spy.log file.
3:59:56 PM
|