Hi Nithyananda,
As you said, you  are using the following code to retrieve the
information....
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");

    }
Instead of specifying the column nos above, try it out by specifying the
column names directly...
i.e.
rset.getString("ename");
etc.
I faced similar problems earlier, but by doing the above I was able to get
rid of it and the program worked just fine too.

Try it out and let me know if it worked.
Regards
Cherag

----- 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

Reply via email to