java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for ‘describe=XXX问题
我在进行数据库更新操作(String sql = "update diseases set name=?,describe=?,cure=?,category=? ";)时,出现了 java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for ‘describe=XXX,,cure=XXX,category=XXX报错。对于这个问题看了许多解决办法,总结如下:
①先查看sql语句有没有问题;
②若sql语句没有问题,则更大的可能是数据库表名有问题,例如我这儿的问题是“describe=”,我这儿的describe可能与数据库内部的某个自定义表名冲突,所以报错。当我吧describe改为description后,问题解决。(这个错误,我在数据库插入时没有发生,仅仅在数据库更新操作时才发生的)