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

 

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