Hi,
I am using WAS7 server and getting the following error.
com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.
here is my code.
private byte[] extractDocxDoc(
String stdNumber) {
byte[] buf=null;
DatabaseAccessObject dao=null;
try {
dao = new DatabaseAccessObject(ApplicationManager.getConnectionConfig());
} catch (TCCException e1) {
// TODO Auto-generated catch block
LogManager.err("EXCEPTION--"+ e1.toString());
}
Blob blob =null;
InputStream iStream =null;
Statement stmnt=null;
ResultSet resultSet=null;
Connection con =null;
String query=AdressSQL.SQL_BLOB_ADRESS + stdNumber+ AdressSQL.WITH_UR;
try
{
con=dao.getConnection();
stmnt=con.createStatement();
resultSet = stmnt.executeQuery(query);
while(resultSet.next())
{
blob = resultSet.getBlob(AdressSQL.STD_BLOB_WPD);
iStream=blob.getBinaryStream();
String dataToIndex=extractText(iStream);
buf = dataToIndex.getBytes();
//buf= blob.getBytes(1,(int)blob.length());
}
}
catch(SQLException sql)
{
System.out.println("HERE IS THE PROBLEM--"+ sql.toString());
System.out.println("HERE IS THE PROBLEM123--"+ sql.getMessage());
LogManager.err("SQLException--"+ sql.toString());
}
catch(TCCException e)
{
LogManager.err("TCCException--"+ e.toString());
}
// amar change ends for SeRV00540613
finally
{
try {
resultSet.close();
stmnt.close();
con.close();
blob=null;
} catch (SQLException e) {
// TODO Auto-generated catch block
LogManager.err("EXCEPTION--"+ e.toString());
}
}
return buf;
}
Please let me know if i am wrong at any place. Any help will be appreciated.