oracle和mysql数据库的批量update在mybatis中配置不太一样:
oracle数据库:
例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
oracle数据库:
- <updateidupdateid="batchUpdate" parameterType="java.util.List">
- <foreach collection="list"item="item"index="index"open="begin"close="end;"separator=";">
- updatetest
- <set>
- test=${item.test}+1
- </set>
- whereid = ${item.id}
- </foreach>
- </update>
例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
- <updateidupdateid="batchUpdate" parameterType="java.util.List">
- <foreach collection="list"item="item"index="index"open=""close=""separator=";">
- updatetest
- <set>
- test=${item.test}+1
- </set>
- whereid = ${item.id}
- </foreach>
- </update>