This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
Is resultset reain open is Connection is closed and resultset is not closed
posted 12 years ago
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
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