偶遇一朋友的一个bug,这个朋友在设计数据库的时候将表名设置成了一个关键字“group”,在后期的编程中遇到了这个问题。
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'group limit 0,5' at line 1
报错代码:
String sql = "select * from group limit ?,?";
解决措施:1` 更改表名;
2` 需要把 group 用撇号`括起来,就是键盘上数据1左边的那个键.