select * from users;
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0");
insert into users(name, age, course_id) VALUES("test",1, "0"),("test",1, "0"),("test",1, "0"),("test",1, "0"),
("test",1, "0"),("test",1, "0"),("test",1, "0"),("test",1, "0"),
("test",1, "0"),("test",1, "0"),("test",1, "0"),("test",1, "0"),
("test",1, "0"),("test",1, "0"),("test",1, "0"),("test",1, "0"),
("test",1, "0"),("test",1, "0"),("test",1, "0"),("test",1, "0"),
("test",1, "0"),("test",1, "0"),("test",1, "0"),("test",1, "0")
在插入上面24条数据的时候发现两者的执行效率相差比较大(近10倍的)
方式一:
方式二:
那么jdbc中的批处理的内部实现是不是采用方式二的形式来实现呢?感兴趣的朋友可以查看下该部分的源码...