慕粉1651148
2017-02-07 15:56
自己在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
找到问题所在了,原因是sql语句写错了应该是from 写成了 form
总结3点想分享给一起努力小伙伴:1.学会使用DEBUG,这是个好东西
2.心细
3.遇到一时解决不了的问题,学会像别人求助或者放一下,让自己休息一下再来看,效率会高很多。
通过自动回复机器人学Mybatis---基础版
107412 学习 · 786 问题
相似问题