A simple solution for debugging JDBC problems, the LogDriver logs all SQL queries to a log4j Stream
JdbcProxy is a JDBC 2.0 driver that can help debug or test applications. The driver can wrap another JDBC driver to debug the JDBC calls done by the application. The driver can also emulate another JDBC driver to test the application without a database.
log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system.