• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with db2driver

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"manohar kvsm",
Please check your private messages.
-Ben
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is this code inside another loop?
Does the while loop need to be inside the if statement?
 
reply
    Bookmark Topic Watch Topic
  • New Topic