Jdatechooser在Xampp数据库中更新日期(NOT UPDATING)

时间:2016-11-22 08:48:43

标签: java sql netbeans xampp jdatechooser

Image is also attached

我在数据库中更新日期有问题,我正在使用带有Xampp数据库的(Java语言)netbeans。 (代码图片在上面的链接中)

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");
    }
}

0 个答案:

没有答案