MyBatis中提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser
生活随笔
收集整理的這篇文章主要介紹了
MyBatis中提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
場景
在進(jìn)行MyBatis查詢數(shù)據(jù)時提示:
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 '?select * from users where userName= 'badao'' at line 1可以確定是sql語句有問題。
定位到此sql語句的位置是userMapper.xml
但是復(fù)制出來sql語句以及控制臺報錯的語句能在數(shù)據(jù)庫中查詢出數(shù)據(jù)。
實現(xiàn)
確定執(zhí)行的sql沒有語法錯誤外,考慮去掉所有無關(guān)的空格和換行等。
然后將全部內(nèi)容剪切出來,然后保存,然后再將內(nèi)容粘貼回去,然后保存。
竟然不報錯了。
總結(jié)
以上是生活随笔為你收集整理的MyBatis中提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MyBatis中提示:元素类型为 map
- 下一篇: 数据库建模工具PowerDesigner