• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing for empty ResultSet

 
Jason Stockmann
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to test to see if a returned resultset is empty in order to trigger a message being displayed...how do i test for an empty resultset?
(Need this ASAP if anyone can help!)
Thanks!
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ June 25, 2002: Message edited by: James Swan ]
 
Jason Stockmann
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, i tried this:

and then using

but when i serve it up to my jsp, it displays it with one less row (the first i believe)...any suggestions anyone?
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok well rs.next() etc. actually moves the db cursor from its current position, so that why you are getting results off by 1.
How about trying something like this instead then:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic