Can't achieve working with p6Spy

浪子不回头ぞ 提交于 2019-12-02 05:30:22
quintonm

I would recommend starting with the latest version of P6Spy 2.x. You should also REPLACE your spy.properties file with the default version for 2.X which is documented here. Depending on your application server, you might need to set the 'realdriver' setting in spy.properties to include 'com.ibm.db2.jcc.DB2Driver'. However, this is only needed when you are using an application server that prevents the automatic registration of JDBC Drivers.

To use P6Spy with Spring, the easiest method is to wrap your current data source bean with P6SpyDataSource as discussed here. The example in that answer shows a JNDI data source being wrapped but it can be used to wrap any data source. Note: If you are wrapping the data source is P6SpyDataSource, you do NOT need to modify the JDBC URL.

If you continue to have problems, please add a bit more information to your question. The following information would be helpful in troubleshooting:

  1. The version of P6Spy being used
  2. The contents of spy.properties
  3. The definition of your datasource (including app server config if using JNDI)
  4. The type of app server and version being used
  5. Stacktrace containing whatever error you might have received.

Have a look at Log4jdbc it'll do the job https://code.google.com/p/log4jdbc/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!