可能重複:
Getting java.sql.SQLException: Operation not allowed after ResultSet closedJDBC異常:操作的ResultSet後不允許關閉
我工作的一些代碼拋出Operation not allowed after ResultSet closed
例外。這裏是:
ResultSet res = stmt.executeQuery("SELECT codigo FROM projecto WHERE nome='"
+ auxiliarNomes.elementAt(i).toString() + "'");
while (res.next()) {
codigo = res.getString("codigo");
stmt.executeUpdate("insert into categoriaprojectos values("
+ "'" + codigo + "'" + "," + "'" + Antena.RetornaCodigoProjecto() + "')");
}
我在做什麼錯了?
搜索「SQL注入」,並找出爲什麼你的SQL建設是錯 – gbn 2012-02-15 10:39:16