resultset

hi frnd how to check resultset null or not ..i am using if(rs==null){}but if loop not executed. could u solve my problem
[134 byte] By [bhupathi@MCAa] at [2007-11-27 9:12:23]
# 1
could you elaborate a bit..-nywled
Redxxiva at 2007-7-12 21:58:50 > top of Java-index,Java Essentials,Java Programming...
# 2
You may like to try this...java.sql.ResultSet rcd = null;if( rcd.equals(null) )take careMohammed Jubaer Arif
Jubaera at 2007-7-12 21:58:50 > top of Java-index,Java Essentials,Java Programming...
# 3

> hi frnd

>

> how to check resultset null or not ..i am using

> if(rs==null){}but if loop not executed. could u solve

> my problem

You're doing that correctly (only an if statement is not a loop).

Your if statement doesn't protect you against getting nulls back from the resultset's get methods, but that's a whole different story.

OleVVa at 2007-7-12 21:58:50 > top of Java-index,Java Essentials,Java Programming...
# 4
Do you mean ResultSet is null or ResultSet is empty?If the latter, the standard way iswhile(rs.next()) {// read stuff from resultset}
-Kayaman-a at 2007-7-12 21:58:50 > top of Java-index,Java Essentials,Java Programming...