liteBatch是一个轻量级,高性能,高通用的批插框架。
能够像普通isert一样在循环中插入PO
支持数据库和文件批插2种模式
异步执行,无阻塞
可以和各种ORM结合使用
提供对sprig的支持
兼容各种数据库
适应所有的VO,自动生成脚本
性能高效,测试机上测试大概4w+/秒
自动处理各种基础类型的数据
支持自定义的映射和过滤字段
QuickStart也可以参考test工程的testUit
try {Radom radom = ew Radom();Perso perso = ull;for (it i = 0; i < 100300; i++) {perso = ew Perso();perso.setAge(radom.extIt(100));perso.setAddress("XX马路"+radom.extIt(100)+"号");perso.setCompay("天天 向上科技有限公司");perso.setName("张三");perso.setCreateTime(ew Date());rowBatchListeer.isertOeWithBatch(perso);}} catch (Exceptio e) {e.pritStackTrace();} fially {rowBatchListeer.flush();}<bea id="rowBatchListeer" class="com.thebeastshop.batch.sprig.RowBatchListeerFactoryBea"><property ame="jdbcTemplate" ref="jdbcTemplate"/><property ame="submitCapacity" value="5000"/><property ame="beaClass" value="com.thebeastshop.batch.test.Perso"/><!--<property ame="sy" value="true"/>默认为false,推荐采用false,打开的话,则为同步模式--></bea>注意在mysql数据库下,需要注意以下几点
驱动包一定得5.1.13版本以上(含)
在jdbc连接url里得加上rewriteBatchedStatemets=true参数










评论