启动MyBatis报错问题
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order (id, name, user_id,
account)
values (2, 'qw', null,
'X0011')' at line 1
很简单,就是mapping中的xml文件中引用了关键字,而没有把该关键字用`` 这个括起来,导致出现这个问题。
修改后:
insert into `order` (id, name, user_id,
account)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},
#{account,jdbcType=VARCHAR})
( ̄▽ ̄)"。。。吃一堑长一智吧。。。