Erreur "Operation not allowed after ResultSet closed"
Salut,
CJe ne vois pas ce que je fais mal. J'ai tenté avec un finally, mais j'ai toujours cette exception.
Si quelqu'un peut m'expliquer. Le jdbc c'est loin :cry:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| public ArrayList<Temp> loadTemp() throws DAOException {
ArrayList<Temp> imm = new ArrayList<Temp>();
String sqlOrder = "";
Connection myConnection = null;
Statement stmt = null;
ResultSet rs = null;
try {
sqlOrder = "SELECT * FROM Temp";
myConnection = Connection.getInstance().getConnection();
stmt = myConnection.createStatement();
rs = DBConnector.executeSql(stmt, sqlOrder, myConnection);
while (rs.next()) {
imm.add(fillImm(rs));
}
rs.close();
stmt.close();
myConnection.close();
return immeubles;
} catch (Exception e) {
throw new DAOException(
"Problem while loading data (sqlOrder="
+ sqlOrder + ")", e);
}
} |
Merci