Thanx all.
   The problem is resolved .

Regds
Nithyananda




Shafi Ahmed <[EMAIL PROTECTED]>@JAVA.SUN.COM> on 04/24/2000 10:19:11 AM

Please respond to "A mailing list for discussion about Sun Microsystem's
      Java Servlet API Technology." <[EMAIL PROTECTED]>

Sent by:  "A mailing list for discussion about Sun Microsystem's Java
      Servlet API Technology." <[EMAIL PROTECTED]>


To:   [EMAIL PROTECTED]
cc:

Subject:


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
------------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of Sema
Group.
If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding, printing,
or copying of this email is strictly prohibited. If you have received this
email in error please notify it to Sema Group sae Helpdesk by telephone on
number
+34 91 4408888.
------------------------------------------------------------------

___________________________________________________________________________
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

Reply via email to