0
我需要編寫一個查詢來更新數據庫中的一行。但例外的是SQL異常。更新jdbc中的行
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:ERREUR德syntaxe PR小號去「設置電子郵件= '11111',SET phoneNumber的= '111111' WHERE name = '薩巴',姓='M'? la ligne 1。
是什麼問題?
public static void updateUser(User user, Connection connection) throws SQLException {
PreparedStatement ps = null;
ps = connection.prepareStatement("UPDATE USERS SET login = ?, SET eMail = ?, SET phoneNumber = ? WHERE name = ?, surname= ?");
ps.setString(1, user.getLogin());
ps.setString(2, user.geteMail());
ps.setString(3, user.getPhoneNumber());
ps.setString(4, user.getName());
ps.setString(5, user.getSurname());
ps.executeUpdate();
所以它的工作。謝謝。 – Dmitry88