private void executeUpsert(Connection connection, MarshalledEntry entry, String keyStr, int segment) throws InterruptedException, SQLException { PreparedStatement ps = null; String sql = tableManager.getUpsertRowSql(); if (trace) { log.tracef("Running sql '%s'. Key string is '%s'", sql, keyStr); } try { ps = connection.prepareStatement(sql); prepareUpsertStatement(entry, keyStr, segment, ps); ps.executeUpdate(); } finally { JdbcUtil.safeClose(ps); } }
try (PreparedStatement upsertBatch = upsertSupported ? connection.prepareStatement(tableManager.getUpsertRowSql()) : null; PreparedStatement deleteBatch = connection.prepareStatement(tableManager.getDeleteRowSql())) {
try { connection = connectionFactory.getConnection(); try (PreparedStatement upsertBatch = connection.prepareStatement(tableManager.getUpsertRowSql())) { int batchSize = 0; for (MarshalledEntry entry : marshalledEntries) {