[jboss-user] [Javassist Users] - Instrumenting SQL execution times (Statement and PreparedSta

joachimhb do-not-reply at jboss.com
Fri Sep 11 17:24:14 EDT 2009


Hello,

Does anyone have any clues as to how its possible to instrument JDBC SQL query times ? I have successfully been able to instrument other classes, but I am unable to find the class that actually executes the Query. 

I have tried, for each class loaded in the classloader, to looks at its implementations to check if one the class implements either java.sql.Statement or java.sql.PreparedStatement. If thats not the case, I check the superclass for up to 10 levels. The application uses DBCP, and the following classes gets instrumented:

java.sql.PreparedStatement
java.sql.CallableStatement
org.apache.commons.dbcp.DelegatingPreparedStatement
org.apache.commons.dbcp.DelegatingStatement
org.apache.derby.iapi.jdbc.EnginePreparedStatement
org.apache.derby.iapi.jdbc.EngineStatement

However, none of these classes seems to fire off the actual execute(), executeQuery() or executeUpdate methods - at least the instrumentation times do not get returned as expected. 

Is there a good strategy to be able to instrument JDBC ? My main goal here is to be able to store the execution times per. SQL that is ran through the system. 


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254860#4254860

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254860



More information about the jboss-user mailing list