Possible Duplicate:
Getting java.sql.SQLException: Operation not allowed after ResultSet closed
I'm working on some code that is throwing Operation not allowed after ResultSet closed
exceptions. Here it is:
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() + "')");
}
What am I doing wrong?