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
| public static void effacer() {
if (con == null)
getConnection();
try {
Statement stmt = con
.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt
.executeQuery("SELECT * FROM Commandes WHERE [No commande] = 10330");
rs.next();
rs.deleteRow();
/*ResultSet rs2 = stmt
.executeQuery("SELECT * FROM Commandes WHERE [No commande] = 10340");
rs2.deleteRow();*/
/*ResultSet rs3 = stmt
.executeQuery("SELECT * FROM Commandes WHERE [No commande] = 10350");
rs3.deleteRow();*/
stmt.close();
con.close();
} catch (Exception e) {
e.printStackTrace();
}
} |
Partager