Inside Scoop on J2EE : Tips and tricks on J2EE and Oracle Application Server by Debu Panda
Updated: 11/18/2004; 5:20:26 PM.

 

Subscribe to "Inside Scoop on J2EE" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Tuesday, March 30, 2004

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    comment []

© Copyright 2004 Debu Panda.

PS: These are my own thoughts and not of my employer ..



Click here to visit the Radio UserLand website.
 


March 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Feb   Apr