Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual tha

问题:

Cause: 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 'case' at line 1
; bad SQL grammar []; nested exception is 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 'case' at line 1] with root cause
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 'case' at line 1

解决方法:

更换数据库表的表名,把case换成tb_case

当然,xml文件和bean也要相应更改。

bean是类声明前加上注释:

@Alias("tb_case")
@TableName("tb_case")
发布了110 篇原创文章 · 获赞 25 · 访问量 16万+

猜你喜欢

转载自blog.csdn.net/qq_32117641/article/details/104733780