main
黄海 2 years ago
parent 29cef3405b
commit 90fef4d855

@ -27,8 +27,7 @@ public class OpenGaussWriteShiWu_JDBC {
// 获取JDBC执行语句对象
stmt = conn.createStatement();
// 批量插入数据的SQL语句
String sql = "INSERT INTO test(id, txt) " +
"VALUES (?, ?)";
String sql = "INSERT INTO test(id, txt) VALUES (?, ?)";
// 预编译SQL语句并添加批量操作数据
long start = System.currentTimeMillis();

@ -62,7 +62,6 @@ public class OpenGaussWriteShiWu_Jfinal {
Connection conn = null;
try {
conn = DbKit.getConfig().getDataSource().getConnection();
DbKit.getConfig().setThreadLocalConnection(conn);
conn.setAutoCommit(false);
String sql = "INSERT INTO test(id, txt) " + "VALUES (?, ?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
@ -87,7 +86,6 @@ public class OpenGaussWriteShiWu_Jfinal {
if (null != conn) {
conn.close();
}
DbKit.getConfig().removeThreadLocalConnection();
}
long end = System.currentTimeMillis();
long elapsed = end - start;

Loading…
Cancel
Save