java.sql.SQLException: Exhausted Resultset

Hi All

I got this error msg "java.sql.SQLException: Exhausted Resultset" when i tried to run my program.

Have read from somewhere that i missed out typing a ResultSet.next(); before calling it out.

However i have already added in ResultSet.next();

Kindly advice on how to solve this problem.

Thanks

Below are some sample codes where out is this:

[2007-06-06 14:14:35] Fully filled trades found

[2007-06-06 14:14:35] Customer ID: 0000123

[2007-06-06 14:14:35] Ref No: 20070606000000021

[2007-06-06 14:14:35] Error in trigger [Error] java.sql.SQLException: Exhausted Resultset

This part is the sample code :

ResultSet rsFilled = psFillAlert.executeQuery();

ResultSet rsUserDetails =null;

//partial filled

ResultSet rsPartialFilled = psPartialFillAlert.executeQuery();

ResultSet rsUserDetails2 =null;

tndg.setRS(rsFilled);

tndg.setRS(rsPartialFilled);

while(tndg.hasNextDoc()){

try{

eventlog.writeln("Fully filled trades found ");

rsFilled.next();

eventlog.writeln("Customer ID: " + rsFilled.getString("cust_id"));

eventlog.writeln("Ref No: " + rsFilled.getString("ref_no"));

userlog.writeln("Fully filled trades found ",false);

userlog.writeln("Customer ID: " + rsFilled.getString("cust_id"),false);

userlog.writeln("Ref No: " + rsFilled.getString("ref_no"),false);

eventlog.writeln("Partially filled trades found ");

rsPartialFilled.next();

eventlog.writeln("Customer ID: " + rsPartialFilled.getString("cust_id"));

eventlog.writeln("Ref No: " + rsPartialFilled.getString("ref_no"));

userlog.writeln("Partially filled trades found ",false);

userlog.writeln("Customer ID: " + rsPartialFilled.getString("cust_id"),false);

userlog.writeln("Ref No: " + rsPartialFilled.getString("ref_no"),false);

Message was edited by:

peachtea

[2867 byte] By [peachteaa] at [2007-11-27 6:33:16]
# 1

double access to rsFilled first column in the while loop:

...

This error occurs when an attempt is made to retrieve a column's value from a ResultSet while the return-value of a previous call to the ResultSet's next() method returned false.

When a call to a ResultSet's next() method returns false, this indicates that there are no more rows left in the ResultSet.

Subsequent attempts to read column-values from the ResultSet result in an error 17011.

...

description taken from

http://www.dbmotive.com/oracle_error_codes.php?errcode=17011

suparenoa at 2007-7-12 17:59:05 > top of Java-index,Java Essentials,Java Programming...
# 2

hi

so that means i have to put rsFilled.next() outside of the while loop?

How abt rsPartialFilled.next();?

Actually both are reading 2 different but almost similar entities

btw even when i did not put in the .next() method, i also got the same output

thanks

Message was edited by:

peachtea

peachteaa at 2007-7-12 17:59:05 > top of Java-index,Java Essentials,Java Programming...
# 3

it's hard to help you because i don't know what you wanna do! i don't know the architecture

of your service so...

the only things that i can tell you are:

- if you wanna explore rsFilled, do a while loop

- the best way to manipulate results is to fill a Collection object(List, ...) with the ResultSet and

doing the treatement on the datas after ...

sup@reno

suparenoa at 2007-7-12 17:59:05 > top of Java-index,Java Essentials,Java Programming...