Anonymous - 2012-11-20

We are using Oracle connection Pooling mechanism in our project as our application uses some oracle specific features.

The configuration of our datasource in jetty.xml is as follows:

<Call name="addService">
<Arg>
  <New class="org.mortbay.jetty.plus.DefaultDataSourceService">
    <Set name="Name">DataSourceService</Set>

    <Call name="addDataSource">
        <Arg>app_ds</Arg><!-java:comp/env->
        <Arg>
         <New class="oracle.jdbc.pool.OracleConnectionPoolDataSource">
            <Set name="description">xxxx</Set>
            <Set name="user">xxx</Set>
            <Set name="password">xxxx</Set>
            <Set name="loginTimeout">xxx</Set>
            <Set name="URL">jdbc:oracle:thin:@localhost:1521:xxx</Set>
        </New>
      </Arg>
    </Call>
     <Call name="start"/>
</New>

Now How do we integrate this datasource with P6Spy, so that P6Spy can print out all the SQL statements on to the console…?

I have previously used P6spy with other datasources like spring's DriverManagerDataSource, other datasources like as
(In Tomcat)

<Resource name="jdbc/test" auth="Container"
      type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
      url="jdbc:oracle:thin:@xxx"
      username="xxx" password="xxx" maxActive="65" maxIdle="10"
      maxWait="-1" removeAbandoned="true"/>
All these datasources take driverClassName as argument where we can provide the "com.p6spyengine.spy.P6SpyDriver" in the place of "oracle.jdbc.driver.OracleDriver" and provide the real driver name in spy.properties. The all worked fine.

But with oracle.jdbc.pool.OracleConnectionPoolDataSource, there is no such property called driverClassName to provide a proxy driver to.

In this case how can i integrate P6Spy with it?

Please help…