tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Then Nam Kheong" <nkt...@magix.com.sg>
Subject Re: Quick JDBC Question
Date Sun, 16 Jul 2000 06:45:44 GMT
This will work:

if(rs.isBeforeFirst()){
    while(rs.next()){
        blah, blah;
    }
}else{
    out.println("No recordes found");
}


----- Original Message ----- 
From: Luis Andrei Cobo <valis@megapathdsl.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Sunday, July 16, 2000 2:07 PM
Subject: Quick JDBC Question


> How can I tell if I resultset returns 0 rows?
> 
> i try this:
> 
> if(rs.next()) {
> while(rs.next()) {
> blah blah
> }
> }
> else {
> blah blah
> }
> 
> yet, when I do that it skips over the first row entirely.
> 
> should I include a count column in the ResultSet perhaps?
> 
> Luis
> 


Mime
View raw message