Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checking the results of a ResultSet

 
Steve Dyke
Ranch Hand
Posts: 1629
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a connection to a remote data table. 9 times out of ten I expect to return more than one record. To get my result I use the while(rs.next()) function. But how do I check to see if there are no records returned. In situations where only one record is expected I use if(rs.next()) which works great. How do I handle the empty while condition?
 
Paul Clapham
Sheriff
Posts: 21149
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic