1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
// ENREGISTREMMENT
String nom = txtnm.getText();
String prnm = txtpr.getText();
String sexe = txtda.getText();
String adr = txtad.getText();
String tel = txttel.getText();
String mdp = txtmdp.getText();
Object stat = txtstat.getSelectedItem();
Object fonc = txtfnct.getSelectedItem();
String req1 = "INSERT INTO profil (idFonction,idStatut) select idFonction,idStatut from fonction,statut Where nomFonction='" + fonc + "' And nomStatut='" + stat + "' ";
String req = "INSERT INTO PROFIL(nom,prenom,sexe,adresse,tel,password) VALUES ('" + nom + "','" + prnm + "','" + sexe + "','" + adr + "','" + tel + "','" + mdp + "')";
try {
stmt.executeUpdate(req);
stmt.executeUpdate(req1);
JOptionPane.showMessageDialog(null, "Insertion Reussie");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erreur d'enregistrement\n" + e.getLocalizedMessage());
} |
Partager