aspose file tools
The moose likes JDBC and Relational Databases and the fly likes ResultSet is closed exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ResultSet is closed exception" Watch "ResultSet is closed exception" New topic
Author

ResultSet is closed exception

Suhem Programmer
Greenhorn

Joined: Feb 13, 2007
Posts: 21
Hi All,

I would appreciate it if somebody could help with below mentioned exception.

5/8/08 11:06:53:810 EDT] 00000024 SystemErr R com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.runtimeXIfNotClosed(WSJdbcResultSet.java:2691)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getString(WSJdbcResultSet.java:1830)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.alticor.ebs.dbaccess.KeyIndQualStatAccess.getAllKeyIndPercntDtl(KeyIndQualStatAccess.java)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.alticor.ebs.ejb.SBTestBean.testKIQualStatSelect(SBTestBean.java)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.alticor.ebs.ejb.EJSRemoteStatelessSBTest_1452a9d4.testKIQualStatSelect(EJSRemoteStatelessSBTest_1452a9d4.java:594)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.alticor.ebs.ejb._EJSRemoteStatelessSBTest_1452a9d4_Tie.testKIQualStatSelect(_EJSRemoteStatelessSBTest_1452a9d4_Tie.java:374)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.alticor.ebs.ejb._EJSRemoteStatelessSBTest_1452a9d4_Tie._invoke(_EJSRemoteStatelessSBTest_1452a9d4_Tie.java:147)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)
[5/8/08 11:06:53:810 EDT] 00000024 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)


The server I am using is WSAD6.1

below is my code

public Collection getAllKeyIndPercntDtl()
{
Collection allKeyIndIBOData = new ArrayList<KeyIndQualStatDtl>();
logger.info("************inside getallkeyInd***********");
logger.debug("**********"+GET_KEY_IND_QUAL_STAT_DTL_STMT+"**********");

Connection aConnection = getConnection();
logger.info("**********got the connection object***********");
ResultSet rs = null;
Statement stmt = null;

try {
stmt = aConnection.createStatement();
rs = stmt.executeQuery(GET_KEY_IND_QUAL_STAT_DTL_STMT);
System.out.println("size of result set is"+rs.getFetchSize());
logger.info(stmt.executeQuery(GET_KEY_IND_QUAL_STAT_DTL_STMT).getStatement());
logger.info("************after executing query******************");
//while(rs.next())
//{
String keyIndCD = rs.getString(1);
Integer bnsPerNO = rs.getInt(2);
BigDecimal affNO = rs.getBigDecimal(3);
String qualStstCD = rs.getString(4);
String qualMthdCD = rs.getString(5);

KeyIndQualStatDtl aKeyIndQualStatDtl = new KeyIndQualStatDtl(keyIndCD,bnsPerNO,affNO,qualStstCD,qualMthdCD);
logger.info("*****constructed data object********");
allKeyIndIBOData.add(aKeyIndQualStatDtl);
//}
} catch (SQLException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}
finally{
logger.info("*************inside finally block**************");
closeConnection(aConnection);
closeStatement(stmt);
}
return allKeyIndIBOData;

}

let me know if i have done anything wrong
When I am debugging my programme following are the logger statements I am getting at consol

O INFO KeyIndQualStatAccess.getAllKeyIndPercntDtl(): ************inside getallkeyInd***********
[5/8/08 11:02:29:666 EDT] 00000024 InternalOracl I DSRA8203I: Database product name : Oracle
[5/8/08 11:02:29:697 EDT] 00000024 InternalOracl I DSRA8204I: Database product version : Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters and Data Mining options
[5/8/08 11:02:29:697 EDT] 00000024 InternalOracl I DSRA8205I: JDBC driver name : Oracle JDBC driver
[5/8/08 11:02:29:697 EDT] 00000024 InternalOracl I DSRA8206I: JDBC driver version : 10.2.0.1.0
[5/8/08 11:02:29:697 EDT] 00000024 InternalOracl I DSRA8212I: DataStoreHelper name is: com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper@74487448.
[5/8/08 11:02:32:181 EDT] 00000024 SystemOut O INFO KeyIndQualStatAccess.getAllKeyIndPercntDtl(): **********got the connection object***********
[5/8/08 11:05:59:197 EDT] 00000024 SystemOut O size of result set is10
[5/8/08 11:06:16:933 EDT] 00000024 SystemOut O INFO KeyIndQualStatAccess.getAllKeyIndPercntDtl(): com.ibm.ws.rsadapter.jdbc.WSJdbcStatement@3600360
[5/8/08 11:06:37:309 EDT] 00000024 SystemOut O INFO KeyIndQualStatAccess.getAllKeyIndPercntDtl(): ************after executing query******************

Thanks
Suhem
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3739
    
  10

Originally posted by suhem chauhan:
logger.info(stmt.executeQuery(GET_KEY_IND_QUAL_STAT_DTL_STMT).getStatement());


Notice anything odd about this line of code? I'll give you a hint, if you remove it you won't get the error.


[OCA 8 Book] [Blog]
Suhem Programmer
Greenhorn

Joined: Feb 13, 2007
Posts: 21
Hi Scott,

Thanks a lot for the reply. I noticed it after posting my problem to the forum and the code is working perfectly fine
Thanks agian
appreciate it!

Suhem
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ResultSet is closed exception