aspose file tools
The moose likes JDBC and Relational Databases and the fly likes ResultSet return value for an empty query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ResultSet return value for an empty query" Watch "ResultSet return value for an empty query" New topic
Author

ResultSet return value for an empty query

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
When a query is executed and no resutls are found what value is returned to the ResultSet. In other words I need to determine if the ResultSet is empty.
What method do I use
thanks david
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Hi David,
After you have obtained a "ResultSet", for example:

then if that "ResultSet" is 'empty', the first invocation of the "ResultSet" methos "next()" will return 'false', as in:

Hope this answers your question.
Good Luck,
Avi.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ResultSet return value for an empty query