You can try like this:

if(rs.next())
{
dosomething();
}
else
{
dosomethingelse();
}


From: James Lee <[EMAIL PROTECTED]>
Reply-To: James Lee <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: how to check ResultSet is null or not?
Date: Thu, 24 Aug 2000 12:27:30 -0400

Hi All,

I want to display a message when the ResultSet is empty from the database.
But when I try to check ResultSet  by using the following methods like:
   if ( rset == null ) {
      //  display the message
   } else {
      //  display the results
   }
it seems not working.  I also tried to use
   if ( !rset.next() )    and  if (!rset.first())  but none of them seems
work.

I am using Weblogic JDBC2.0 connection pool.  It works fine if I do not
check the ResultSet and just display them.  Only thing is I got a blank page
if no results.

Any suggestions?

James Lee

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to