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

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/mygod2020/article/details/102728537

测试类中一直报错,原因是说写的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});

猜你喜欢

转载自blog.csdn.net/mygod2020/article/details/102728537