zoukankan      html  css  js  c++  java
  • MyBatis Sql语句中的转义字符

    1、在xml的sql语句中,不能直接用大于号、小于号要用转义字符

    如果用小于号会报错误如下:

    org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

    转义字符

                         <                                 

                         <

                         小于号                                           

                         &gt;

                         >                                      

                         大于号

                         &amp;

                         &

                         和

                         &apos;

                         ’

                         单引号

                         &quot;

                         "

                         双引号

    2、使用
    <![CDATA[ ]]>标记的sql语句中的<where> <if>等标签不会被解析

  • 相关阅读:
    ReactNative 打包 APK
    ReactNative常用命令
    ReactNative之坑:停在gradle一直出点
    Python搭建Web服务器,与Ajax交互,接收处理Get和Post请求的简易结构
    tensorflow 安装升级
    sqlserver 全库查询 带架构
    气象数据资料整理
    poj2841
    cf1430e
    cf1436d
  • 原文地址:https://www.cnblogs.com/ceshi2016/p/6202676.html
Copyright © 2011-2022 走看看