亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

控制臺報的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下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號