I’ve recently seen an advertisement for JDBCLint on the H2 User Group. JDBCLint is an Apache licensed JDBC proxy implementation that does some plausibility checks on the lifecycles of your JDBC objects. For instance, it
- Checks if a ResultSet is closed twice
- Checks if a ResultSet is not closed at all (in the finalizer)
- Checks if a ResultSet yields unread columns
All of these checks can be disabled by specifying relevant properties on the proxy. And the best thing is that this proxy is so easy to integrate:
import com.maginatics.jdbclint.ConnectionProxy; ... Connection connection = DriverManager.getConnection(...); connection = ConnectionProxy.newInstance( connection, new Properties()); connection.close(); // reports error and optionally throws exception connection.close();
Certainly a tool to have on your tool chain!