• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet when no rows found

 
Martin Lira
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have some jdbc code


Is the ResultSet null when the result is "no rows found", will rs.close() give me an error.

Thanks,
Martin
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin,
The resultset is never null. So rs.next() will return false and rs.close() will close the empty resultset.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic