• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting error that"com.ibm.db 2.jcc.c.SqlException -- Invalid operation: result set closed" in was7

 
sachin pate
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try {
vectQueryInput = new Vector();
vectQueryInput.addElement(aCoid.trim());
vectQueryInput.addElement(aCoid.trim());
vectQueryInput.addElement(aCoid.trim());
vectQueryInput.addElement(aCoid.trim());
vectQueryInput.addElement(aCoid.trim());
vectQueryInput.addElement(aCoid.trim());

strQueryFileName = PSVPropertyFileConstant.PROPERTY_FILE_GET_SPCLB_FOR_VIEWPIP;
strSQLQuery = FileUtils.generateQuery(strQueryFileName, vectQueryInput);
con = getConnection(URL,USER,PSWD);
stmt = con.createStatement();
rs = stmt.executeQuery(strSQLQuery);

Model modelB = new Model();

while (rs.next()) {
strAttribute = rs.getString(1);
StringTokenizer st = new StringTokenizer(strAttribute, ":");
while (st.hasMoreTokens()) {
strAttribute = st.nextToken();
strValue = st.nextToken();
if (strAttribute.equals("A")) {
modelB.setVIEWPIPSPCLATT1(strAttribute);
modelB.setVIEWPIPSPCLVAL1(strValue);

} else if (strAttribute.equals("B")) {
modelB.setVIEWPIPSPCLATT2(strAttribute);
modelB.setVIEWPIPSPCLVAL2(strValue);

} else if (strAttribute.equals("C")) {
modelB.setVIEWPIPSPCLATT3(strAttribute);
modelB.setVIEWPIPSPCLVAL3(strValue);

} else if (strAttribute.equals("H")) {
modelB.setVIEWPIPSPCLATT4(strAttribute);
modelB.setVIEWPIPSPCLVAL4(strValue);

} else if (strAttribute.equals("S")) {
modelB.setVIEWPIPSPCLATT5(strAttribute);
modelB.setVIEWPIPSPCLVAL5(strValue);

} else if (strAttribute.equals("T")) {
modelB.setVIEWPIPSPCLATT6(strAttribute);
modelB.setVIEWPIPSPCLVAL6(strValue);
}
}
}

if (rs.wasNull()) {
strAttribute = "";
}

arrSpclBlock.add(modelB);

} catch (SQLException ex) {

ex.printStackTrace();

} catch (Exception e) {
e.printStackTrace();

} finally {
try {
if (rs != null)
rs.close();
if (stmt != null)
stmt.close();
if (con != null)
con.close();

} catch (SQLException e) {
e.printStackTrace();
}

}


return arrSpclBlock;
}
 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this out http://www-01.ibm.com/support/docview.wss?uid=swg21461670

What JDBC version you using? Did it work before and now doesn't? Was the JDBC driver updated to a newer version?
 
sachin pate
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


What JDBC version you using? Did it work before and now doesn't? Was the JDBC driver updated to a newer version?us

Previously I was using JDBC type2 and Right now I am using JDBC type 4.I also tried your given link but still it giving same error.

Please help me to resolve the issue.
 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link I posted shows what needs to be done to resolve the problem. eg changing program to cater the rs.next() "not closing after looping all rows".
 
Campbell Ritchie
Sheriff
Pie
Posts: 50196
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this might fit better in a databases forum: moving.
 
sachin pate
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link I posted shows what needs to be done to resolve the problem. eg changing program to cater the rs.next() "not closing after looping all rows".


thank you K.Tsang

Problem resolved.
Thank you again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic