PreparedStatement ps;
String query = "INSERT INTO order (table_id,dish_id,price,count) VALUES (?,?,?,?)";
try {
con = DBHelper.getCon();
ps = con.prepareStatement(query);
ps.setInt(1, order.getTable_id());
ps.setInt(2, order.getDish_id());
ps.setInt(3, order.getPrice());
ps.setInt(4, order.getCount());
result = ps.executeUpdate();
...
I have error in executeUpdate() method. It shows
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near error.
How can I fix it?