Earlier i was using jvm parameters for data base connection URL, user, password. But now, i started using jboss datasource defined in jboss/default/deploy as an xml qds.xml
I am using c3po for connection pooling. When i run my application , i get following exception : java.sql.SQLException: Already closed at org.jboss.resource.adapter.jdbc.WrappedStatement.close(WrappedStatement.java:69)
This error is generally thrown in finally block where i am closing pstmt.close();
Interestingly, pstmt.closed is false before committing the transaction but when it invokes pstmt.close(), it finds pstmt already closed( closed=true) and throws the above execption.
It used to work fine till we started using jboss data source.
I love problems like these because the exception in this case is extremely helpful. If you're getting a message that a statement is closed, then it is closed. You're task is to figure out why.
Try posting your entire JDBC code snippet (minus the queries) and/or consider in what cases other processes might be closing your objects. 9 times out of 10, connection closed can be traced to a coding error.
Ack, just realized this thread is probably dead since Patricia posted it 9 months ago... For Pedro: my comments still apply. [ September 10, 2008: Message edited by: Scott Selikoff ]