This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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.
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 ]