转自:http://www.myexception.cn/j2ee/587183.html

 

String str ="select * from tab1"
把str传入的ibatis中执行,是传递整条sql语句...

XML code

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="sql">
    <!-- selectBySql -->
    <select 
            remapResults="true" parameterClass="java.lang.String">
    <![CDATA[ $sql$ ]]>
    </select>
    <!-- updateBySql -->
    <update >
    <![CDATA[ $sql$ ]]>
    </update>
</sqlMap>

相关文章:

  • 2022-12-23
  • 2022-03-04
  • 2021-04-15
  • 2022-12-23
  • 2022-01-03
  • 2021-12-24
  • 2022-12-23
  • 2022-03-02
猜你喜欢
  • 2021-06-22
  • 2021-08-12
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案