0

Image is also attached

i have problem in date update in Database, and i am using netbeans for (java language) with Xampp Database. (code image is in link above)

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
    // TODO add your handling code here:
    String a = ((JTextField)jDateChooser1.getDateEditor().getUiComponent()).getText();
    String s1=jTextField1.getText();
    String s2=jTextField2.getText();
    String s3=jTextField3.getText();
    if(s1.isEmpty() || s2.isEmpty() || s3.isEmpty() || a.isEmpty()  )
    {
        JOptionPane.showMessageDialog(null, "Fill All Fields Before Update");
    }
    else
    {
        String query;
        query = "UPDATE medicine SET price='"+s3+"',quantity='"+s2+"',Expiry Date='"+a+"' WHERE name = '"+s1+"'";
        executeSQlQuery(query,"Updated");
    }
}
chiwangc
  • 3,566
  • 16
  • 26
  • 32
  • 1
    [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) – Michael Faisst Nov 22 '16 at 08:50
  • Welcome to Stackoverflow. Please, read these links to improve your question: [Tour](http://stackoverflow.com/tour) | [How to ask](http://stackoverflow.com/help/how-to-ask) | [Minimal, Complete and Verifiable Example](http://stackoverflow.com/help/mcve) – Tom Nov 22 '16 at 09:15

0 Answers0