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 about Null in ResultSet 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 "about Null in ResultSet" Watch "about Null in ResultSet" New topic

about Null in ResultSet

saravana kumar
Ranch Hand

Joined: Jun 25, 2002
Posts: 72
hi friends,
i needs ur help. how to check wheather Result is null or Not.i have written a query which is selecting data from table with one condition. if there is none of a record satisfied the condition it should be returned null. how to check that one? any one knows please let me know with example.

thanks a lot friends...
sandeep balyan
Ranch Hand

Joined: Jul 25, 2001
Posts: 134
do this
do that


Want to do something great will do one day
Nandkishore Dhilde

Joined: May 09, 2002
Posts: 20
or you can do after firing query
int rowcount = rs.getRow(); //rs is ResultSet object
if(rowcount ==0) // then ur query returns null result and if more than 0 then go for

SCJP1.4 certified, IBM SOA Solution Designer[2007]
I agree. Here's the link:
subject: about Null in ResultSet
It's not a secret anymore!