您好,欢迎来到客趣旅游网。
搜索
您的当前位置:首页mybatis执行批量更新batchupdate的方法(oracle,mysql)_MySQL

mybatis执行批量更新batchupdate的方法(oracle,mysql)_MySQL

来源:客趣旅游网

oracle和mysql数据库的批量update在mybatis中配置不太一样:

oracle数据库:

	 	 	update test 		 test=${item.test}+1		where id = ${item.id}	 	 

mysql数据库:

mysql数据库采用一下写法即可执行,但是数据库连接必须配置:&allowMultiQueries=true

例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true

	 	 	update test 		 test=${item.test}+1		where id = ${item.id}	 	 

Copyright © 2019- kqyc.cn 版权所有 赣ICP备2024042808号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务