This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes ResultSet when no rows found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ResultSet when no rows found" Watch "ResultSet when no rows found" New topic

ResultSet when no rows found

Martin Lira
Ranch Hand

Joined: May 26, 2004
Posts: 97
I have some jdbc code

Is the ResultSet null when the result is "no rows found", will rs.close() give me an error.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33134

The resultset is never null. So will return false and rs.close() will close the empty resultset.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: ResultSet when no rows found
jQuery in Action, 3rd edition