Ken Bloom wrote:
I have noticed that Connector/J 3.1.x is very strict about making sure
to close all of your Statements and ResultSets. If you don't close them,
the consequence is a leak of memory and of database resources.
I would argue that it's not the driver's business to know about this,
nor is it its function. Some connection pools (Resin, Tomcat/DBCP,
Primrose) will do this for you, however. If you are doing this in the
web tier, you can just have a servlet request listener do this checking
for you. If you are not, just close them! If you need help finding
these in a large source tree, there are tools like PMD and FindBugs to
do the hunting for you. It's probably a good idea to use them, anyway.