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")

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章