I have a third party application that uses JDBC to connect to and query a database. The performance of this application is quite poor and I would like to produce a trace of the calls that the application is making in to the JDBC driver - I have found a number of places that talk about how to enable logging of the JDBCODBC driver when you are codinging the program that is using the driver, but none on how to invoke tracing when you don't have control over the source code. The examples I have found all involve calling java.sql.DriverManager.setLogStream(java.lang.System.out);
I have tried using P6Spy's JDBC driver, but this only logs SQLStatements executed by the application, and I would like to log all JDBC calls (the application I want to trace makes heavy use of the metadata functions within the JDBC API).
I am really hoping there's a way to invoke the trace functionality either through parameters passed in on the database connection URL or through environment variables.
Thanks for any help,