Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
rohit nabh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic