dcsimg
JDBC Connection cannot be reused
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ken_Hensel
Posted On:   Wednesday, December 14, 2005 07:31 PM

I hope someone can help please. I'm using JDBC to connect to DB2 and execute a stored procedure. The process is very simple and I'm seeing the same behavior in my web app, stand-alone java procedures and now in DbVisualizer. I connect to DB2 using the connect string, execute the stored procedure as: call myproc() The call works fine the first time. If I try to call it again, I get an error. In DbVisualizer: 16:18:25 [CALL - 0 row(s), 0.050 secs] Command processed but no rows were affected 1 statement(s) executed, 0 row(s) affected, database exec time 0.050 sec [0 successful, 1 warnings, 0 errors]    More>>

I hope someone can help please.



I'm using JDBC to connect to DB2 and execute a stored procedure. The process is very simple and I'm seeing the same behavior in my web app, stand-alone java procedures and now in DbVisualizer.



I connect to DB2 using the connect string, execute the stored procedure as:



call myproc()



The call works fine the first time. If I try to call it again, I get an error.



In DbVisualizer:




16:18:25 [CALL - 0 row(s), 0.050 secs] Command processed but no rows were affected

1 statement(s) executed, 0 row(s) affected, database exec time 0.050 sec [0 successful, 1 warnings, 0 errors]




JDBC in web app using connection pool:




18:44:32,862 ERROR [StudentDaoDB2Impl] Caught SQLException: java.sql.CallableStatement.executeQuery() was called but no result set was returned. Use java.sql.CallableStatement.executeUpdate() for non-queries.




Here is my datasource in jboss:




<?xml version="1.0" encoding="UTF-8"?>





TestDS

jdbc:db2:mydb2y

com.ibm.db2.jcc.DB2Driver

5000

10

20

10



TestDbRealm









Any help would be greatly appreciated as this is extremely baffling!



Thanks, Ken

   <<Less

Re: JDBC Connection cannot be reused

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, December 24, 2005 06:16 PM

Sounds like a bug in your stored procedure. Maybe some static fields that need to be reset, if they persist once the procedure gets loaded the first time in the database, etc.?
About | Sitemap | Contact