我正在尝试从我的程序运行查询,当我检查日志时收到以下错误消息,请提供解决方案/建议。
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -420, SQLSTATE: 22018, SQLERRMC: DOUBLE
at com.ibm.db2.jcc.b.hh.b(hh.java:1369)
at com.ibm.db2.jcc.b.hh.c(hh.java:1356)
at com.ibm.db2.jcc.c.db.k(db.java:352)
at com.ibm.db2.jcc.c.db.a(db.java:60)
at com.ibm.db2.jcc.c.t.a(t.java:52)
at com.ibm.db2.jcc.c.tb.b(tb.java:202)
at com.ibm.db2.jcc.b.ih.ab(ih.java:1898)
at com.ibm.db2.jcc.b.ih.d(ih.java:2467)
at com.ibm.db2.jcc.b.ih.W(ih.java:525)
at com.ibm.db2.jcc.b.ih.executeUpdate(ih.java:508)
at com.test.internal.updateImp.updateRow(updateImp.java:**107**)
代码:
public int updateRow(String jobID ,Connection connect) throws Exception{
int cnt =0;
Statement stmt = null;
try {
stmt = connect.createStatement();
String query = dbConnection.UPDATE_EMPLOYEE.toString();
query = query.replace("?", jobID); //line 107
cnt = stmt.executeUpdate(query);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try{
if(stmt != null) stmt.close();
}catch(Exception ex){
ex.printStackTrace();
}
}
return cnt;
}
查询是
UPDATE INTRA.EMPLOYEE SET STATUS = 'Y' WHERE JOB_ID IN (?)