mysql大于号小于号转义
时间: 2023-08-26 15:17:32 浏览: 177
大于号和小于号在MyBatis中需要进行转义,否则会出现意想不到的错误。这是因为在MyBatis的mapper XML文件中,大于号和小于号被视为标签符号,与SQL中的符号发生冲突,导致解析过程出现问题。为了解决这个问题,可以采用两种方案。
方案一是使用转义写法,将大于号和小于号替换为对应的转义字符。例如,将大于号替换为">",将小于号替换为"<"。
方案二是使用CDATA标记,将SQL语句包裹在<![CDATA<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [MyBatis中大于和小于号的转义写法](https://blog.csdn.net/weixin_35976295/article/details/113338260)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [java MyBatis中大于和小于号的转义写法](https://blog.csdn.net/csdndys/article/details/129883495)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [mybatis xml sql语句报错:大于号、小于号的转义写法 Error creating document instance](https://blog.csdn.net/forthrlock/article/details/106812320)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文