JDBC Call Logger Proxy Driver
What
The JDBC Call Logger Proxy Driver is a proxy JDBC driver that sits in front of a JDBC Driver intercepts and logs all JDBC call made by the calling JDBC application.
Why
When debugging JDBC Driver issues, the ability to log the JDBC call being made to a JDBC Drivers can be useful in debugging the cause for the issue.
How
To use the JDBC Logger proxy extract the contents of the JdbcLoggers.zip to a location of your choice and add the following jar files in the zip file to your Java CLASSPATH environment variable:
CLASSPATH=jdbcproxy.jar;slf4j-api-1.5.10.jar;slf4j-log4j12-1.5.10.jar;log4j-1.2.15.jar
The JDBC logger has the following JDBC Driver name which the existing JDBC Driver name in the JDBC application is replaced with:
org.jdbcproxy.Driver
Then the JDBC connect string to invoke the JDBC Logger Proxy driver is of the form:
jdbc:proxy:{original-jdbc-driver-name}:{original-jdbc-driver-connect-string}
The given an original JDBC driver name of openlink.jdbc4.Driver
and JDBC connect string of jdbc:openlink://localhost/SVT=ODBC/Database=dsn-name\UID=dba\UID=dba
, these would correspond to the {original-jdbc-driver-name}
and {original-jdbc-driver-connect-string}
respectively, resulting in a JDBC Logger Proxy driver connect string of:
jdbc:proxy:openlink.jdbc4.Driver:jdbc:openlink://localhost/SVT=ODBC/Database=dsn-name\UID=dba\UID=dba
Then with the JDBC application using above JDBC Logger Proxy JDBC driver name and connect string for connecting to the target database ie
JDBC Driver Name: org.jdbcproxy.Driver
JDBC Connect String: jdbc:proxy:{original-jdbc-driver-name}:{original-jdbc-driver-connect-string}
a file call jdbc.log
will be created in the directory the application runs from, containing a log of all JDBC call made by the calling JDBC application.