Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You have written some tests that create JDBC objects such as connections, statements, and result sets. You want to avoid leaking resources by ensuring that your tests clean themselves up.
There are a number of problems with leaking JDBC resources. For one, you can easily defeat the purpose of JDBC connection pooling by holding on to connections until the database gives up waiting for you and orphans them, rendering them unusable. This article we found on the Web describes the problem in more detail.[12]
[12] From “WebSpherePro System Admin Tips,” May 28, 2003 issue (www.e-promag.com/epnewsletters). Use search keywords “connection pooling performance”.