wood burning stoves 2.0*
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet when no rows found" Watch "ResultSet when no rows found" New topic
Author

ResultSet when no rows found

Martin Lira
Ranch Hand

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


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

Thanks,
Martin
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResultSet when no rows found
 
Similar Threads
Callable Statement Resultset
How do you check is Result set is null
how is close() used?
java.sql.SQLException: No data read
The conversion of the varchar value '5438954444' overflowed an int column.