Skip to content

Commit 8a91aac

Browse files
committed
update
1 parent 510f38f commit 8a91aac

File tree

4 files changed

+333
-89
lines changed

4 files changed

+333
-89
lines changed

database/code/JDBC/.idea/workspace.xml

Lines changed: 20 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-88 Bytes
Binary file not shown.

database/code/JDBC/src/Test.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import java.sql.Connection;
2+
import java.sql.Date;
23
import java.sql.DriverManager;
34
import java.sql.PreparedStatement;
45

56
public class Test {
67
public static void main(String[] args) throws Exception{
78
Class.forName("com.mysql.jdbc.Driver");
89
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db1","root","123456");
9-
PreparedStatement pstmt = conn.prepareStatement("insert into psn values(?,?)");
10-
for (int i = 0; i < 20000; i++) {
10+
PreparedStatement pstmt = conn.prepareStatement("insert into tblA(age,birth) values (?,?);");
11+
for (int i = 200000; i < 1000000; i++) {
1112
pstmt.setInt(1,i);
12-
pstmt.setString(2,i+"");
13+
pstmt.setDate(2,new Date(new java.util.Date().getTime()));
1314
pstmt.addBatch();
1415
}
1516
pstmt.executeBatch();

0 commit comments

Comments
 (0)