Good day everyone, I'm trying to save an inputted data using JTextfield in JAVA GUI into MySQL database.
But when i pressed the save button nothing happens. I want to show you all my work right now.
Please try to help me, Thank you in advance!
if(e.getSource().equals(save)) { //THE SAVE BUTTON
String ID=CustAcctNum.getText();
int AcctNum=Integer.parseInt(ID);
String fname=CustFName.getText();
String lname=CustLName.getText();
String tel=CustTelNum.getText();
String city=CustCity.getText();
String zcode=CustZCode.getText();
String status=CustStat.getText();
String creditcard=CreditCNum.getText();
String order=CustOrDt.getText();
String dfee=CustDFee.getText();
String inumber=MnuINum.getText();
String icost=MnuCost.getText();
String tcost=TotalCost.getText();
try {
rs.moveToInsertRow();
rs.updateInt(ID, AcctNum);
rs.updateString("CustFName", fname);
rs.updateString("CustLName", lname);
rs.updateString("CustTelNum", tel);
rs.updateString("CustCity", city);
rs.updateString("CustZCode", zcode);
rs.updateString("CustStat", status);
rs.updateString("CreditCNum", creditcard);
rs.updateString("CustOrDt", order);
rs.updateString("CustDFee", dfee);
rs.updateString("MnuINum", inumber);
rs.updateString("MnuCost", icost);
rs.updateString("TotalCost", tcost);
rs.insertRow();
st.executeQuery("INSERT INTO pizzadb.ordertable VALUES (ID,'fname','lname','tel'" +
"'city','zcode','status','creditcard','order','dfee','inumber','icost','tcost')");
st.close();
rs.close();
}catch(SQLException err){
JOptionPane.showMessageDialog(null, err.getMessage());
}}