为了账号安全,请及时绑定邮箱和手机立即绑定

控制台报的SQL语法错误,很奇怪

58997d2f000109e005000196.jpg

58997d300001677405000141.jpg

58997d300001eff905000262.jpg

58997d310001fa8705000040.jpg

自己在DEBUG模式下运行,程序执行到MaintainService下的deleteBatch下的dao.deleteBatch(idList)就报错

下面是报错的部分信息:

<==      Total: 3
==>  Preparing: delete form MESSAGE where ID in( ? , ? )
==> Parameters: 2(Integer), 3(Integer)
二月 07, 2017 3:38:37 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [com.sgu.tj.servlet.DeleteBatch] in context with path [/MyBatis] threw exception
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: 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 'MESSAGE where ID in(  2 , 3 )' at line 1
### The error may involve Message.deleteBatch-Inline
### The error occurred while setting parameters
### SQL: delete form MESSAGE where ID in(  ? , ? )
### Cause: 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 'MESSAGE where ID in(  2 , 3 )' at line 1

正在回答

1 回答

找到问题所在了,原因是sql语句写错了应该是from 写成了 form

总结3点想分享给一起努力小伙伴:1.学会使用DEBUG,这是个好东西

2.心细

3.遇到一时解决不了的问题,学会像别人求助或者放一下,让自己休息一下再来看,效率会高很多。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

控制台报的SQL语法错误,很奇怪

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信