1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| try{
statement = conn.createStatement();
String sql = ("INSERT INTO stock(categorie,designation,quantity,prix_u,total,client) VALUES(?,?,?,?,?,'"+(clientLb.getText())+"')");
for (int i = 0; i < d.getRowCount(); i++){
for (int j = 0; j < d.getColumnCount(); j++){
}
int s = statement.executeUpdate(sql);
if(s>0){
JOptionPane.showMessageDialog(null,"Ajout Termine Success ! ","Success",JOptionPane.PLAIN_MESSAGE);
}
else {
JOptionPane.showMessageDialog(null,"Echec lors de l'Ajout, Veillez reessayer ! ","Erreur",1);
}
bd.Deconnexion();
}
}
catch (SQLException ex){
JOptionPane.showMessageDialog(null, "Echec lors de l'ajout !");
} |
Partager