When I saved data with MyBatis today, I suddenly found an error! Org. apache. ibatis. exceptions. PersistenceException: ### Errorupdatingdatabase. Cause: java. SQL. SQLException: usage: & quot; YouhaveanerrorinyourSQLsyntax; checkthemanual mybatismysql#ql
When I saved data with MyBatis today, I suddenly found an error!
Org. apache. ibatis. exceptions. PersistenceException:
Error updating database. cause: java. SQL. SQLException: Syntax error or access violation message from server: "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 'desc, link, pubDate, source, title, channelId, imageurls)
Values ('Hangzhou Xihu Hu 'at line 2"
The error may involve /. addNews-InlineThe error occurred while setting parametersSQL: insert into News (desc, link, pubDate, source, title, channelId, imageurls) values (?,?,?,?,?,?,?)
It is estimated that the saved string has double quotation marks! How can I solve this problem by calling keyProperty = "id" useGeneratedKeys = "true">
Insert into News
(Desc, link, pubDate, source, title, channelId, imageurls)
Values
(# {Desc}, # {link}, # {pubDate}, # {source}, # {title}, # {channelId}, # {imageurls })