public String moveHlrCode(String ids,String hlr_id, Connection con) throws DaoException {
Connection inter = null;
Statement st = null;
ResultSet rs = null;
try{
if (con == null)
inter = ConnDB_WL.getConnection();
else{
inter = con;
}
st=inter.createStatement();
String now = DateUtil.getCurrentDateString("yyyy-MM-dd HH:mm:ss");
String sql = "update c_ne_hlr_code set hlr_id=" + hlr_id + " where int_id in (" + ids + ")";
st.executeUpdate(sql);
String id[] = ids.split(",");
for(int i = 0;i<id.length;i++){
sql = "select region_id,ne_working_state from c_ne_hlr where int_id = (select hlr_id from c_ne_hlr_code where int_id =" + id[i] + "))";
rs = st.executeQuery(sql);
if(rs.next()){
GBll gbll = new GBll();
gbll.setInt_id(Integer.parseInt(id[i]));
gbll.setChange_type(Constants.NE_CHANGE_TYPE_UPDATE);
gbll.setNe_type("HLR_CODE");
gbll.setRegion_id(rs.getInt("region_id"));
gbll.setTimestamp(now);
gbll.setWorking_state_flag(rs.getInt("ne_working_state"));
saveGBll(gbll,inter);
}
}
inter.commit();
}catch(Exception e){
logger.error("move hlrcode failed.");
try {
inter.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
throw new DaoException(e.getMessage());
}finally{
JDBCUtil.close(rs,st,inter);
}
return "success";
}
Connection inter = null;
Statement st = null;
ResultSet rs = null;
try{
if (con == null)
inter = ConnDB_WL.getConnection();
else{
inter = con;
}
st=inter.createStatement();
String now = DateUtil.getCurrentDateString("yyyy-MM-dd HH:mm:ss");
String sql = "update c_ne_hlr_code set hlr_id=" + hlr_id + " where int_id in (" + ids + ")";
st.executeUpdate(sql);
String id[] = ids.split(",");
for(int i = 0;i<id.length;i++){
sql = "select region_id,ne_working_state from c_ne_hlr where int_id = (select hlr_id from c_ne_hlr_code where int_id =" + id[i] + "))";
rs = st.executeQuery(sql);
if(rs.next()){
GBll gbll = new GBll();
gbll.setInt_id(Integer.parseInt(id[i]));
gbll.setChange_type(Constants.NE_CHANGE_TYPE_UPDATE);
gbll.setNe_type("HLR_CODE");
gbll.setRegion_id(rs.getInt("region_id"));
gbll.setTimestamp(now);
gbll.setWorking_state_flag(rs.getInt("ne_working_state"));
saveGBll(gbll,inter);
}
}
inter.commit();
}catch(Exception e){
logger.error("move hlrcode failed.");
try {
inter.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
throw new DaoException(e.getMessage());
}finally{
JDBCUtil.close(rs,st,inter);
}
return "success";
}
java.sql.SQLSyntaxErrorException: ORA-00933: SQL 命令未正确结束 at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)哪儿有问题 求指导一下