Try this out
String query="SELECT ename,sal,job,mgr FROM members";
rs = stmt.executeQuery(query);
// Display the result set as a list
while(rs.next()) {
employeename=rs.getString("ename").trim();
Job=rs.getString("job").trim();
return true;}
Try to get the values of all fields by qerying their names
----- Original Message -----
From: pranav kumar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 22, 2000 10:44 AM
> Hi,
> Please check the order of the fields in the table 'emp'.
> Bye
> ----- Original Message -----
> From: Nithyananda Thiagarajan <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 21, 2000 2:23 PM
>
>
> > Hi all,
> > When trying to execute a query "Select ename,sal,job,mgr from
emp
> "
> > , from a servlet using jdbc I get the error
> > Error in SQLjava.sql.SQLException:
> Exhausted
> > Resultset.
> > When I replace the query to select and display a single column ,
> it
> > functions as expected.
> > Can anybody throw some light on why this might happen?
> >
> >
> > Here is the portion of the code:
> > Statement stmt = conn.createStatement ();
> >
> > // Select the ENAME column from the EMP table
> > ResultSet rset = stmt.executeQuery ("Select ename,sal,job,mgr from
emp
> ");
> > // Iterate through the result and print the employee names
> > while (rset.next ())
> > out.println (rset.getString (1));
> > out.println (rset.getFloat (2));
> > out.println (rset.getString (3));
> > out.println (rset.getInt (4));
> > out.println("SQL Success");
> >
> > }
> > catch(SQLException r)
> > {
> > out.println("Error in SQL"+r);
> > }
> >
> >
> >
> >
> > Thanx and regds
> > Nithyananda
> >
> >
>
___________________________________________________________________________
> > 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
>
>
___________________________________________________________________________
> 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
___________________________________________________________________________
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