Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLException: Connection is closed

843859Oct 17 2005 — edited Oct 20 2005
Hi,
I am getting the "java.sql.SQLException: Connection is closed" now and then in production there is no code fault as bze this error does not get thrown daily. i am using apache DBCP connection pooling to get the connection.
Sample code is as follows...

con = DBUtil.getConnection();
st = con.createStatement();
......
....

the first statement gets executed successfully and returns connection object . when it goes to create the Statement object the following erros gets posted.

java.sql.SQLException: Connection is closed.0: org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.java:274)1: org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:199)2:
...........
................
I am unable to say the ROOT CAUSE of this issue...Could you please help me to figure out the ROOT CAUSE and when it happens.
My assumption is like Connection object is getting shared across the requests and getting closed pre-maturely.

Thanks in advance..
-Jayaram.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2005
Added on Oct 17 2005
10 comments
3,144 views