1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| private void UPDATEActionPerformed(java.awt.event.ActionEvent evt) {
boolean succes=false;
if(String.valueOf(cat.getSelectedItem()).equals("Monture")){
try{
Statement s=connecter.connectDB().createStatement();
int r=s.executeUpdate("UPDATE Article SET Code_art ="+code.getText()+",cat_art ="+(String)cat.getSelectedItem()+",Réf_mon ="+ref.getText()+",WHERE code_art ="+code.getText());
Statement s2=connecter.connectDB().createStatement();
int r2=s2.executeUpdate("UPDATE Monture SET Réf_mon ="+ref.getText()+",Coul_mon ="+coul.getText()+",Mod_mon ="+mod.getText()+",Pu_mon ="+prix.getText()+",Qté_mon ="+qte.getText()+",Taille_mon ="+taille.getText()+",WHERE Réf_mon ="+ref.getText());
if(r!=0&&r2!=0){
JOptionPane.showMessageDialog(null, "Mise à jour d'article effectue avec succés");
succes=true;
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
// TODO add your handling code here:
} |
Partager