System.out.println(String.format("QuickOrm NORMAL INSERT %s rows data used time:%s ms", dataRowCount, (endTime - beginTime)));
}
public static void JdbcNormalInsert(int dataRowCount) {
User testUser = new User();
testUser.setName("TestUser");
testUser.setLoginName("testuser");
testUser.setPassword("xxxxxxxxxxxx");
long beginTime = System.currentTimeMillis();
try {
Connection conn = Program.dataSource.getConnection();
conn.setAutoCommit(false);
for (int i = 0; i <= dataRowCount - 1; i++) {
testUser.setUserId(UUID.randomUUID().toString().replace("-", ""));
PreparedStatement stat = conn.prepareStatement("INSERT INTO User(UserId, Name, LoginName, Password) VALUES (?, ?, ?, ?);");
stat.setObject(1, testUser.getUserId());
stat.setObject(2, testUser.getName());
stat.setObject(3, testUser.getLoginName());
stat.setObject(4, testUser.getPassword());
stat.executeUpdate();
}
conn.commit();
} catch (Exception ex) {