2020
10-10
10-10
教你如何6秒钟往MySQL插入100万条数据的实现
一、思路往MySQL中插入1000000条数据只花了6秒钟!关键点:1.使用PreparedStatement对象2.rewriteBatchedStatements=true开启批量插入,插入只执行一次,所有插入比较快。二、代码packagetest0823.demo1;importjava.sql.*;/***@author:Bei-Zhen*@date:2020-08-240:43*/publicclassJDBC2{//staticintcount=0;publicstaticvoidmain(String[]args){longstart=System.currentTimeMillis();co...
继续阅读 >