tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Locasto" <loca...@cs.columbia.edu>
Subject Re: DB2 and servlet ??? Help !!!
Date Thu, 01 Aug 2002 18:09:51 GMT
Hi,

Assuming this is the SQL you want to submit:

>
>                         try{
>                 stmt = con.createStatement();
>                                 rs = stmt.executeQuery("SELECT empno
from
> db2admin.employee");

shouldn't it be

if( rs.next() ){

    do{
      count++;
      out.println( " empno is "+rs.getString( 1 ) );

    }while( rs.next() );

}

or something along those lines? (rather than the !rs.next() )

>
>                          try{
>                                  if(!rs.next())
>                                    {
>                                                    count = count +1;
>                                      String a = rs.getString(1);
>
>                            out.println(" empno is " + a );
>                     out.println("<BR><BR>While Count is"+ count);
>                    }




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message