每次執(zhí)行都報錯,提示的錯誤位置還不一定
for(...){
...
Connection conn = null;
Statement stmt = null;
...
stmt = conn.createStatement();
int n=stmt.executeUpdate("update 表1 set ... where ...");
stmt.executeUpdate("delete from 表2 where...");
stmt.executeUpdate("update 表2,表3 set ... where ...");
stmt.executeUpdate("update 表2 set ... where ...");
while(){
....
rs = stmt.executeQuery(sql.toString());
...
rs = stmt.executeQuery(sql.toString());
...
}
}
1 回答

動漫人物
TA貢獻1815條經驗 獲得超10個贊
Connection?和statement要在for循環(huán)之前創(chuàng)建,
如: Connection conn=getConnection();
???????? stmt =? conn.createStatement();
?? for(.......){.................}
添加回答
舉報
0/150
提交
取消