jdbc批處理

Statement 和PreparedStatement都有addBatch(String sql)方法,然後調用executeBatch()方法執行批處理. Statement stmt = null; try { stmt = conn.createStatement(); for (String sql : batch) { stmt.addBatch(sql); } stmt.executeBatch(); } catch (SQLException e) { throw e; } 

你可能感兴趣的:(jdbc批處理)