Two Laptop Bag
The moose likes JDBC and the fly likes connection not closed Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "connection not closed" Watch "connection not closed" New topic
Author

connection not closed

senthil kumar
Greenhorn

Joined: Mar 19, 2008
Posts: 13
Is there some tool to find out the code where the connection is not closed properly? I am getting connection issues and have huge applicaation where I cannot look into each and every program to find whether the connection is closed.any advice will be highly appreciated. thanks
Santhosh Reddy
Greenhorn

Joined: Sep 25, 2006
Posts: 27
instead of checking the closing of connection,make your that the code which deals with the connection , is kept in try block and in the finally block close the connections,especially check the transction part , whether you have ended the transaction or not.
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
A have solved this kind of problem with a single class which handles the connection with the database and also closes the connection. This class is tested and I know for sure that the resultset and the needed connection is closed.

If you've a huge application it's important to have a good design in which you have a separation of concern.


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
I agree. Here's the link: http://jrebel.com/download
 
subject: connection not closed
 
Similar Threads
missing expression error
maximum open cursors exceeded
java.sql.SQLException: Closed Connection
DriverManagerConnectionPool
oracle connection pool setting and database cursors