posted 15 years ago
Hi,
I am getting the following exception
com.ibm.db2.jcc.b.SqlException: Invalid operation: result set closed
I am using db2, what i am doing is
if(rs.next){
do some thing
while(rs.next()){
do some thing else
}
}
The above code i have wrote in one scenario, it is working with oracle and sqlserver. But with db2 it is failing, i know when rs.next() in while loop reaches end of rows in table it returns false and also it is getting closed. when again it comes to the if condition it is failing and throwing the exception, because i am calling the rs.next() after closing the resultset because it is my requirement.
I am using Resultset.Type_Forward_Only. even i tried with scroll_sensitive and scroll_insensitive also.
Caused by: com.ibm.db2.jcc.b.SqlException: Invalid operation: result set closed
at com.ibm.db2.jcc.b.rc.mb(rc.java:3413)
at com.ibm.db2.jcc.b.rc.c(rc.java:290)
at com.ibm.db2.jcc.b.rc.next(rc.java:277)
at com.soa.monitoring.export.UsageExporter.writeRow(UsageExporter.java:121)
... 19 more
Can some one help me on this issue..