1. 下载p6spy-install.zip
2. 在webshpere6控制上创建一个数据源xxxDataSource;
3. 将spy.jar和spy.properties拷贝到IBM\SDP70\runtimes\base_v61\lib
并修改spy.properties的realdriver=oracle.jdbc.driver.OracleDriver
4. 修改spring中数据源配置
Xml代码
<!-- bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/xxxDataSource"/>
</bean -->
Xml代码
<bean id="dataSource" class="com.p6spy.engine.spy.P6DataSource" destroy-method="close">
<constructor-arg>
<ref local="dataSourceTarget"/>
</constructor-arg>
</bean>
<bean id="dataSourceTarget" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/xxxDataSource"/>
</bean>