File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes Checking the results of a ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Checking the results of a ResultSet" Watch "Checking the results of a ResultSet" New topic

Checking the results of a ResultSet

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
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( 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( which works great. How do I handle the empty while condition?
Paul Clapham

Joined: Oct 14, 2005
Posts: 18121

I agree. Here's the link:
subject: Checking the results of a ResultSet
Similar Threads
Check the result set
ResultSet and count urgent please help
Please Help me Ranchers
unexpected output
Checking if ResultSet is empty