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 'show,del_flag FROM dog
WHERE del_flag=0' at line 1
报错如上,明明写得都对,还是报错,原因是:我们的属性名起的不对,比如我的show属性在sql中show代表一个关键字,改名就好了
在Java SQL查询中,遇到'You have an error in your SQL syntax',问题出在将保留关键字'show'用于属性名,解决办法是更改属性名以避免与SQL关键字冲突。
301

被折叠的 条评论
为什么被折叠?



