首页 > 数据库> > Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
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});
标签:jdbc,jdbc4,name,sex,birthday,user,SQL,password,id 来源: https://blog.csdn.net/mygod2020/article/details/102728537