src/main/java/org/embulk/output/jdbc/StandardBatchInsert.java in embulk-output-jdbc-0.2.2 vs src/main/java/org/embulk/output/jdbc/StandardBatchInsert.java in embulk-output-jdbc-0.2.3

- old
+ new

@@ -30,14 +30,20 @@ } public void prepare(String loadTable, JdbcSchema insertSchema) throws SQLException { this.connection = connector.connect(true); - this.batch = connection.prepareInsertSql(loadTable, insertSchema); + this.batch = newPreparedStatement(connection, loadTable, insertSchema); this.index = 1; // PreparedStatement index begings from 1 this.batchRows = 0; this.totalRows = 0; batch.clearBatch(); + } + + protected PreparedStatement newPreparedStatement(JdbcOutputConnection connection, + String loadTable, JdbcSchema insertSchema) throws SQLException + { + return connection.prepareInsertSql(loadTable, insertSchema); } public int getBatchWeight() { return batchWeight;