1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
//modifier ligne commande
private void cmd_update_lig_cmActionPerformed(java.awt.event.ActionEvent evt) {
try{
String val1=txt_ref_com.getText();
String val2=txt_qt_com.getText();
String sql="update ligne_commande set quantite_prd_comm='"+val2+"',ref='"+val1+"' where ref='"+val1+"' and id_ligne_comm=?";
if(conn!=null){pst=conn.prepareStatement(sql);}
if(pst!=null){
pst.setString(1,tt.getText());
pst.execute();}
update_tabe2();
JOptionPane.showMessageDialog(null,"La ligne commande est Modifier avec succés");
}catch(HeadlessException | SQLException e){
JOptionPane.showMessageDialog(null,e);
}finally{
try{
rs.close();
pst.close();
}catch(SQLException e){
}
}
} |