jdbc-protolib/src/main/java/com/streamsets/pipeline/stage/processor/jdbctee/JdbcTeeProcessor.java
@Override
  public void process(Batch batch, SingleLaneBatchMaker batchMaker) throws StageException {
    if (!batch.getRecords().hasNext()) {
      // No records - take the opportunity to clean up the cache so that we don't hold on to memory indefinitely
      cacheCleaner.periodicCleanUp();
    }

    boolean perRecord = false;
    // MS SQL Server does not support returning generateKey after executeBatch
    // Instead of executeBatch, do executeUpdate per record
    if (hikariConfigBean.getConnectionString().toLowerCase().startsWith("jdbc:sqlserver")) {
      perRecord = true;
    }

    if (dynamicTableName) {
      jdbcUtil.write(
          batch,
          tableNameEval,
          tableNameVars,
          tableNameTemplate,
          recordWriters,
          errorRecordHandler,
          perRecord
      );
    } else {
      jdbcUtil.write(batch.getRecords(), tableNameTemplate, recordWriters, errorRecordHandler, perRecord);
    }

    Iterator<Record> it = batch.getRecords();
    while (it.hasNext()) {
      batchMaker.addRecord(it.next());
    }
  }
@Override
  public void process(Batch batch, SingleLaneBatchMaker batchMaker) throws StageException {
    if (!batch.getRecords().hasNext()) {
      // No records - take the opportunity to clean up the cache so that we don't hold on to memory indefinitely
      cacheCleaner.periodicCleanUp();
    }

    boolean perRecord = false;
    // MS SQL Server does not support returning generateKey after executeBatch
    // Instead of executeBatch, do executeUpdate per record
    if (hikariConfigBean.getConnectionString().toLowerCase().startsWith("jdbc:sqlserver")) {
      perRecord = true;
    }

    if (dynamicTableName) {
      jdbcUtil.write(
          batch,
          tableNameEval,
          tableNameVars,
          tableNameTemplate,
          recordWriters,
          errorRecordHandler,
          perRecord
      );
    } else {
      jdbcUtil.write(batch.getRecords(), tableNameTemplate, recordWriters, errorRecordHandler, perRecord);
    }

    Iterator<Record> it = batch.getRecords();
    while (it.hasNext()) {
      batchMaker.addRecord(it.next());
    }
  }
@ Override public void process ( Batch batch , SingleLaneBatchMaker batchMaker ) throws StageException { if ( ! batch . getRecords ( ) . hasNext ( ) ) { // No records - take the opportunity to clean up the cache so that we don't hold on to memory indefinitely cacheCleaner . periodicCleanUp ( ) ; } boolean perRecord = false ; // MS SQL Server does not support returning generateKey after executeBatch // Instead of executeBatch, do executeUpdate per record if ( hikariConfigBean . getConnectionString ( ) . toLowerCase ( ) . startsWith ( "jdbc:sqlserver" ) ) { perRecord = true ; } if ( dynamicTableName ) { jdbcUtil . write ( batch , tableNameEval , tableNameVars , tableNameTemplate , recordWriters , errorRecordHandler , perRecord ) ; } else { jdbcUtil . write ( batch . getRecords ( ) , tableNameTemplate , recordWriters , errorRecordHandler , perRecord ) ; } Iterator < Record > it = batch . getRecords ( ) ; while ( it . hasNext ( ) ) { batchMaker . addRecord ( it . next ( ) ) ; } }
{@inheritDoc}
{