wangbin1992321 2015-08-18 13:45 采纳率: 0%
浏览 11293

MyBatis如何保存带有双引号的字符串

今天用MyBatis保存数据的时候突然发现报错了!
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
    ('杭州西湖湖' at line 2"

The error may involve /.addNews-Inline

The error occurred while setting parameters

SQL: insert into News (desc,link,pubDate,source,title,channelId,imageurls) values (?,?,?,?,?,?,?)

初步估计应该是因为保存的字符串有双引号的关系!求大神致电如何解决这种问题 keyProperty="id" useGeneratedKeys="true">
insert into News
(desc,link,pubDate,source,title,channelId,imageurls)
values
(#{desc},#{link},#{pubDate},#{source},#{title},#{channelId},#{imageurls})




  • 写回答

2条回答 默认 最新

  • devmiao 2015-08-18 15:43
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料