Explicitly closing Statements, ResultSets, and Connections You should explicitly close Statements, ResultSets, and Connections when you no longer need them. Explicit close of JDBC objects

Connections to are resources external to an application, and the garbage collector will not close them automatically.

For example, close a Statement object using its close method; close a Connection object using its close method. If auto-commit is disabled, active transactions need to be explicitly committed or rolled back before closing the connection