Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我试图用java更新mysql中的日期时出现MySQLSyntaxErrorException_Java_Mysql - Fatal编程技术网

我试图用java更新mysql中的日期时出现MySQLSyntaxErrorException

我试图用java更新mysql中的日期时出现MySQLSyntaxErrorException,java,mysql,Java,Mysql,我的错误: 严重:空 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以了解在第1行的“WHERE CustLogin”附近使用的正确语法,如“patryk”。 这是更新: "UPDATE customers SET CustPassword = ?, CustFirstName = ?," + " CustLastName = ?, CustAddress

我的错误: 严重:空 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以了解在第1行的“WHERE CustLogin”附近使用的正确语法,如“patryk”。 这是更新:

"UPDATE customers SET CustPassword = ?, CustFirstName = ?," +
    " CustLastName = ?, CustAddress = ?, CustCity = ?, CustProv = ?, CustPostal = ?," +
    " CustCountry = ?, CustHomePhone = ?, CustBusPhone = ?, CustEmail = ?, AgentId = ?," +
    " WHERE CustLogin LIKE ?";
kompilator与stmt.executeUpdate()有问题

有以下屏幕代码:

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


我认为错误是因为“用户登录前…”

换成,

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

我想你有一个额外的
之前,其中
条款被删除,但仍然不起作用。Thx的评论你能用新的查询和异常跟踪更新问题吗?。将代码粘贴为文本,我发现代码中有一些不一致之处,但删除逗号的提示确实有帮助(我没有看到)。再次感谢您,祝您有愉快的一天