测试类中一直报错,原因是说写的sql语句错误,但是对比之前正确的也没有错啊,百度看了下,别人的是写成中文的,我这里主要出现的错误是id左右带的括号我写成中括号了、、、
update tb_user
set
user_name = #{userName},
password = #{password},
name = #{name},
age = #{age},
sex = #{sex},
birthday = #{birthday},
updated = NOW()
where
{id = #{id};
正确如下id 部分
UPDATE tb_user
SET
user_name = #{userName},
password = #{password},
name = #{name},
age = #{age},
sex = #{sex},
birthday = #{birthday},
updated = NOW()
WHERE
(id = #{id});
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
最新推荐文章于 2023-05-03 21:32:57 发布