Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ResultSet when no rows found  RSS feed

 
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: 36875
481
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
Boost this thread!