My Oracle Support Banner

How To Ensure No ResultSet/Connection/Statement Leaks Exist in Your JDBC Code (Doc ID 402480.1)

Last updated on DECEMBER 11, 2023

Applies to:

JDBC - Version 9.0.3 and later
Oracle Containers for J2EE - Version 9.0.4.0.0 to 10.1.3.5.0 [Release AS10g to AS10gR3]
Oracle Database - Enterprise Edition - Version 12.2.0.1 to 12.2.0.1 [Release 12.2]
Information in this document applies to any platform.

Goal

When using JDBC, it is the programmer's responsibility to ensure they release resources obtained from connections, resultsets, and statements. A popular approach is to use the DAO (Data Access Object) J2EE pattern, but by doing this the programmer must ensure they release the resources associated with using the JDBC API. This article shows how to ensure that all resources are cleanly closed in your program and gives a very simple utility for releasing resources.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 Problems
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.