aspose file tools*
The moose likes JDBC and the fly likes Is resultset reain open is Connection is closed and resultset is not closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Is resultset reain open is Connection is closed and resultset is not closed" Watch "Is resultset reain open is Connection is closed and resultset is not closed" New topic
Author

Is resultset reain open is Connection is closed and resultset is not closed

rohit nabh
Greenhorn

Joined: Jan 13, 2004
Posts: 8
hi all,
I am coding DAO.
There are lots of methods in DAO's and i am closing connection in finally block and not closing resultset.
I am getting errror like lot of connections are open and it is not able to make new connections.
Is this error is due to i am not closing the resultset in finally block.
My each request is a interaction with database and there are lot of user
will this error come.
regards,
Rohit
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

It's always good practise to close all resultsets, statements and Connections immidiately after you are finished with them to relieve unnecessary stress on the DB. Having said that, There should be no adverse affects according to the JDBC specs. Of course, these are only specifications, so that does not guarantee that they actually do it! If it is any consolation, I've never experienced this problem using Oracle thin drivers, not sure which drivers you're using
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is resultset reain open is Connection is closed and resultset is not closed