Vous êtes sur la page 1sur 1

methode supprimer sur le traitement

public void supprimer(int Id){

connexionDB sup = new connexionDB();


sup.con();

String req1 = "select * from user where Id='"+Id+"' ";


try {
ResultSet res = sup.ST.executeQuery(req1);
if(res.next()){
int input = JOptionPane.showConfirmDialog(null, "voulez vous
supprimer" );
if(input == 0){

String req = "delete From User where id ='"+Id+"'";


sup.ST.executeUpdate(req);
JOptionPane.showMessageDialog(null, "suppression effectuer");
}
}
else {
JOptionPane.showMessageDialog(null, "Utilisateur introuvable");
}
} catch (SQLException ex) {
Logger.getLogger(TraitementUser.class.getName()).log(Level.SEVERE,
null, ex);
}

---------------------------------------------------------------------------

button supprimer

// TODO add your handling code here:


int Id = Integer.parseInt(jTextField5.getText());
TraitementUser tu = new TraitementUser();

tu.supprimer(Id);
remplirTableau();
jTextField5.setText("");

-------------------------------------------------------------------

Vous aimerez peut-être aussi