Hi,
We are on db2 7.2 on win2k and were using the JDBC1 drivers and all was
working fine. We just switched to the JDBC2 driver and now are seeing tons
of errors that we never saw before.
Example code that works in db2 jdbc1 driver.
// get statement
op = con.prepareStatement(sql);
try {
rs = op.executeQuery();
}
catch (SQLException e) {
log("Die on executing statement in genericSqlGet()"+ sql,e);
}
// build result collection
try {
while (rs.next()) {
.............
..........
However when switching to db2's JDBC2 driver we get the following exception
when calling rs.next() (note the executeQuery() and prepareStatement() throw
no execeptions.
EXCEPTION: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT]
SQL0501N The cursor specified in a FETCH or CLOSE statement is not open.
SQLSTATE=24501
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0501N The
cursor specified in a FETCH or CLOSE statement is not open. SQLSTATE=24501
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGe
nerator.java:254)
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGe
nerator.java:197)
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_r eturn_code(SQLExceptionGen
erator.java:436)
at COM.ibm.db2.jdbc.app.DB2ResultSet.next(DB2ResultSe t.java:473)