jdbc-protolib/src/main/java/com/streamsets/pipeline/stage/processor/jdbcmetadata/JdbcMetadataProcessor.java
@Override
  protected List<ConfigIssue> init() {
    // Validate configuration values and open any required resources.
    List<ConfigIssue> issues = super.init();

    errorRecordHandler = new DefaultErrorRecordHandler(getContext());
    elEvals.init(getContext());

    Processor.Context context = getContext();

    issues.addAll(hikariConfigBean.validateConfigs(context, issues));

    if (issues.isEmpty() && null == dataSource) {
      try {
        dataSource = jdbcUtil.createDataSourceForWrite(hikariConfigBean, null, null,
            false,
            issues,
            Collections.emptyList(),
            getContext()
        );
      } catch (RuntimeException | SQLException | StageException e) {
        LOG.debug("Could not connect to data source", e);
        issues.add(getContext().createConfigIssue(Groups.JDBC.name(), CONNECTION_STRING, JdbcErrors.JDBC_00, e.toString()));
      }
    }

    if (issues.isEmpty()) {
      try {
        schemaWriter = JdbcSchemaWriterFactory.create(hikariConfigBean.getConnectionString(), dataSource);
      } catch (JdbcStageCheckedException e) {
        issues.add(getContext().createConfigIssue(Groups.JDBC.name(), CONNECTION_STRING, e.getErrorCode(), e.getParams()));
      }
      schemaReader = new JdbcSchemaReader(dataSource, schemaWriter);

      tableCache = CacheBuilder.newBuilder().maximumSize(50).build(new CacheLoader<Pair<String, String>, LinkedHashMap<String, JdbcTypeInfo>>() {
        @Override
        public LinkedHashMap<String, JdbcTypeInfo> load(Pair<String, String> pair) throws Exception {
          return schemaReader.getTableSchema(pair.getLeft(), pair.getRight());
        }
      });
    }

    // If issues is not empty, the UI will inform the user of each configuration issue in the list.
    return issues;
  }
@Override
  protected List<ConfigIssue> init() {
    // Validate configuration values and open any required resources.
    List<ConfigIssue> issues = super.init();

    errorRecordHandler = new DefaultErrorRecordHandler(getContext());
    elEvals.init(getContext());

    Processor.Context context = getContext();

    issues.addAll(hikariConfigBean.validateConfigs(context, issues));

    if (issues.isEmpty() && null == dataSource) {
      try {
        dataSource = jdbcUtil.createDataSourceForWrite(hikariConfigBean, null, null,
            false,
            issues,
            Collections.emptyList(),
            getContext()
        );
      } catch (RuntimeException | SQLException | StageException e) {
        LOG.debug("Could not connect to data source", e);
        issues.add(getContext().createConfigIssue(Groups.JDBC.name(), CONNECTION_STRING, JdbcErrors.JDBC_00, e.toString()));
      }
    }

    if (issues.isEmpty()) {
      try {
        schemaWriter = JdbcSchemaWriterFactory.create(hikariConfigBean.getConnectionString(), dataSource);
      } catch (JdbcStageCheckedException e) {
        issues.add(getContext().createConfigIssue(Groups.JDBC.name(), CONNECTION_STRING, e.getErrorCode(), e.getParams()));
      }
      schemaReader = new JdbcSchemaReader(dataSource, schemaWriter);

      tableCache = CacheBuilder.newBuilder().maximumSize(50).build(new CacheLoader<Pair<String, String>, LinkedHashMap<String, JdbcTypeInfo>>() {
        @Override
        public LinkedHashMap<String, JdbcTypeInfo> load(Pair<String, String> pair) throws Exception {
          return schemaReader.getTableSchema(pair.getLeft(), pair.getRight());
        }
      });
    }

    // If issues is not empty, the UI will inform the user of each configuration issue in the list.
    return issues;
  }
@ Override protected List < ConfigIssue > init ( ) { // Validate configuration values and open any required resources. List < ConfigIssue > issues = super . init ( ) ; errorRecordHandler = new DefaultErrorRecordHandler ( getContext ( ) ) ; elEvals . init ( getContext ( ) ) ; Processor . Context context = getContext ( ) ; issues . addAll ( hikariConfigBean . validateConfigs ( context , issues ) ) ; if ( issues . isEmpty ( ) && null == dataSource ) { try { dataSource = jdbcUtil . createDataSourceForWrite ( hikariConfigBean , null , null , false , issues , Collections . emptyList ( ) , getContext ( ) ) ; } catch ( RuntimeException | SQLException | StageException e ) { LOG . debug ( "Could not connect to data source" , e ) ; issues . add ( getContext ( ) . createConfigIssue ( Groups . JDBC . name ( ) , CONNECTION_STRING , JdbcErrors . JDBC_00 , e . toString ( ) ) ) ; } } if ( issues . isEmpty ( ) ) { try { schemaWriter = JdbcSchemaWriterFactory . create ( hikariConfigBean . getConnectionString ( ) , dataSource ) ; } catch ( JdbcStageCheckedException e ) { issues . add ( getContext ( ) . createConfigIssue ( Groups . JDBC . name ( ) , CONNECTION_STRING , e . getErrorCode ( ) , e . getParams ( ) ) ) ; } schemaReader = new JdbcSchemaReader ( dataSource , schemaWriter ) ; tableCache = CacheBuilder . newBuilder ( ) . maximumSize ( 50 ) . build ( new CacheLoader < Pair < String , String > , LinkedHashMap < String , JdbcTypeInfo > > ( ) { @ Override public LinkedHashMap < String , JdbcTypeInfo > load ( Pair < String , String > pair ) throws Exception { return schemaReader . getTableSchema ( pair . getLeft ( ) , pair . getRight ( ) ) ; } } ) ; } // If issues is not empty, the UI will inform the user of each configuration issue in the list. return issues ; }
{@inheritDoc}
{