> 데이터 베이스 > MySQL 튜토리얼 > mybatis-MyBatis如何保存带有双引号的字符串

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
풀어 주다: 2016-06-06 09:39:06
원래의
3278명이 탐색했습니다.

mybatismysqljavasql

今天用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)

<code>    values    ('杭州西湖湖' at line 2"</code>
로그인 후 복사

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})

<code></code>
로그인 후 복사
로그인 후 복사
로그인 후 복사
<code></code>
로그인 후 복사
로그인 후 복사
로그인 후 복사
<code></code>
로그인 후 복사
로그인 후 복사
로그인 후 복사
관련 라벨:
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿