I am trying to Update a table in mysql and this is the code:
PreparedStatement ps = con.prepareStatement("UPDATE PbnNumberPlayer SET jointime=?, unique=? WHERE server=?");
ps.setInt(1, jointime);
ps.setInt(2, unique);
ps.setString(3, name);
ps.executeUpdate();
ps.close();
The error that I got is:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'unique=0 WHERE server='pbns4'' at line 1
jointime,uniqueornamehave at the moment. Please post the entire section of code.ps.executeQuery();instead ofps.executeUpdate();as well.