• 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
Sheriff
Posts: 36003
422
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!