该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
一、编写测试案例向MySQL数据库中插入百万条数据。测试数据表建表脚本如下:use db_xk;
drop table if exists tb_test2;
create table tb_test2 (
id int primary
key auto_increment,
subject varchar(50) not null,
description varchar(200)
not null,
teacher_id int(10) zerofill not null,
student_id int(10)
zerofill default null,
state boolean not null default false
);state
boolean not null default false
);
测试案例源码如下:
package test;
import java.sql.Connection;
import
java.sql.PreparedStatement;
import java.sql.SQLException;
import
util.DBUtil;
public class TestDataBase2 {
public static void main(String[]
args) {
Connection conn = DBUtil.getConnection();
String sql = "insert into tb_test2(s