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
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
場景
在進行MyBatis查詢數據時提示:
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
但是復制出來sql語句以及控制臺報錯的語句能在數據庫中查詢出數據。
實現
確定執行的sql沒有語法錯誤外,考慮去掉所有無關的空格和換行等。
然后將全部內容剪切出來,然后保存,然后再將內容粘貼回去,然后保存。
竟然不報錯了。
總結
以上是生活随笔為你收集整理的MyBatis中提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MyBatis中提示:元素类型为 map
- 下一篇: Java中获取域名、端口号、项目名等实现