MySQLSyntaxErrorException,而我试图在mysql中用java更新日期。

我的错误。SEVERE: nullcom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 你的SQL语法有错误;检查你的MySQL服务器版本对应的手册,在第1行的’WHERE CustLogin LIKE ‘patryk”附近查看正确的语法.这是更新。

"UPDATE customers SET CustPassword = ?, CustFirstName = ?," +
    " CustLastName = ?, CustAddress = ?, CustCity = ?, CustProv = ?, CustPostal = ?," +
    " CustCountry = ?, CustHomePhone = ?, CustBusPhone = ?, CustEmail = ?, AgentId = ?," +
    " WHERE CustLogin LIKE ?";

kompilator与stmt.executeUpdate()有问题。

有屏幕代码。

enter image description here

我认为更新没有错误,数据库工作正常,因为例如,我可以添加客户你有什么想法?

update

解决方案:

我认为错误是因为WHERE CustLogin前的”,”…。

用”,”代替。

"UPDATE customers SET CustPassword = ?, CustFirstName = ?," +
    " CustLastName = ?, CustAddress = ?, CustCity = ?, CustProv = ?, CustPostal = ?," +
    " CustCountry = ?, CustHomePhone = ?, CustBusPhone = ?, CustEmail = ?, AgentId = ?" +
    " WHERE CustLogin LIKE ?";

本文来自投稿,不代表实战宝典立场,如若转载,请注明出处:https://www.shizhanbaodian.com/40164.html

(0)
上一篇 21小时前
下一篇 21小时前

相关推荐

发表评论

登录后才能评论