[JDBC/Mysql] next() : Operation not allowed ResultSet close
Salut...
J'ai un petit problème en JDBC.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Statement st=co.createStatement();
ResultSet rs;
String req;
req=new String("SELECT TapId,CotId ...");
rs=st.executeQuery(req);
while(rs.next())
{
int tap=rs.getInt(1);
int cot=rs.getInt(2);
req=new String("DELETE FROM TAP_COTE WHERE CotId="+cot+";");
st.execute(req);
req=new String("DELETE FROM TAP_TAP WHERE TapId="+tap+";");
st.execute(req);
} |
Le rs.next() me gènère l'erreur suivante :
Citation:
Exception in thread "main" java.sql.SQLException: Operation not allowed after ResultSet closed
at com.mysql.jdbc.ResultSet.checkClosed(ResultSet.java:4324)
at com.mysql.jdbc.ResultSet.next(ResultSet.java:2868)
Je ne comprends pas alors is vous avez une idée...
Merci