The above code works fine for most of the calls but in some calls I get the following error that is caught in the respective "setDBMethods" :
DB_ERROR : While doing query for method1:: DETAILS: COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0601E Invalid statement handle or statement is closed. SQLSTATE=S1000
The connection is opened and closed normally as i can see those messages in the log. The strange thing is when i am creating a new statement for each call, then I cant comprehend the cause of the error.
The DB2 driver being used is : COM.ibm.db2.jdbc.app.DB2Driver
Is there a problem with the code or am i missing something. Please help me.
Lu Battist
Ranch Hand
Joined: Feb 17, 2003
Posts: 104
posted
0
It looked good to me, but maybe the connection is not open at the time. Also, you might want to close the result set somewhere.
A few well placed debug statements might help:
[ June 04, 2004: Message edited by: Lu Battist ]
preeti mansingh
Greenhorn
Joined: Jun 04, 2004
Posts: 2
posted
0
Originally posted by Lu Battist: [QB]It looked good to me, but maybe the connection is not open at the time. Also, you might want to close the result set somewhere.
A few well placed debug statements might help:
--------------
I liked the idea of debug statements, I will put that and try running to see if that is a possible scenario.
For the other suggestion of closing the result set, doesn't the underlying result set get close on closing the statement? That is what javadoc says or is it driver dependent?
I believe your handling of JDBC resources is what is causing the strange behavior. Take a look at this thread for a more detailed discussion about how I feel resources should be properly managed when using JDBC. [ June 06, 2004: Message edited by: Chris Mathews ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.