Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet closing - regarding

 
PN Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a situation where in i need to use a set of queries, one after the other, to obtain data from different tables. Is it a must to close the statement and resultSet after each of the query?Won't the resultSet change with the statement(or the query)? Is there any specific advantage of closing the result set each time? The query output would be only one row for each of the queries.
 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is good form to explicity close all of the JDBC objects when you are done with them. Close them in a "finally" block, so they get closed even in the event of an exception.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic