I want to update my data and delete it and replace it to another table for a single time. I don't know how to do this.
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version right syntax to use near'(Cash,Change)values('9000','Your Change is:40.0')where Room='9' and Name' at line 1
try{
chge=jTextField27.getText();
cash=jTextField4.getText();
String SQLL = "update customer (Cash,Chnge) values ('" + cash + "','" + chge + "') where Room = ? and Name = ?;";
Dbase5 = conn.prepareStatement (SQLL);
Dbase5.setString(1,jTextField1.getText());
Dbase5.setString(2,jTextField2.getText());
int b = Dbase5.executeUpdate();
////////MOVE TO HISTORY
String SQL = "INSERT INTO history select * from customer where Room = ? and Name = ?";
Dbase = conn.prepareStatement (SQL);
Dbase.setString(1,jTextField1.getText());
Dbase.setString(2,jTextField2.getText());
int rs=Dbase.executeUpdate();
///////MOVE TO HISTORY
String MSQL = "delete from customer where Room=? and Name=?";
Dbase1 = conn.prepareStatement (MSQL);
Dbase1.setString(1,jTextField1.getText());
Dbase1.setString(2,jTextField2.getText());
boolean s = Dbase1.execute();
this.dispose();
update customer set Cash = '123', Chnge = 'foo' where Room = '42' and Name = 'John'?