Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL

测试类中一直报错,原因是说写的sql语句错误,但是对比之前正确的也没有错啊,百度看了下,别人的是写成中文的,我这里主要出现的错误是id左右带的括号我写成中括号了、、、

update tb_user
set
user_name = #{userName},
password = #{password},
name = #{name},
age = #{age},
sex = #{sex},
birthday = #{birthday},
updated = NOW()
where
{id = #{id};



UPDATE tb_user
SET
user_name = #{userName},
password = #{password},
name = #{name},
age = #{age},
sex = #{sex},
birthday = #{birthday},
updated = NOW()
WHERE
(id = #{id});

上一篇:MYSQL报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException


下一篇:troubshooting-sqoop 导出 TiDB表数据报com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicatio