All Implemented Interfaces:
DataExceptionContributor, JsonSerializable, RecordSerializable, XmlSerializable, DataReaderFactory, JavaCodeGenerator, Serializable

public class JdbcPipelineInput extends PipelineInput
Reads a pipeline's source data from a database query using a JdbcReader.
See Also:
  • Constructor Details

    • JdbcPipelineInput

      public JdbcPipelineInput()
  • Method Details

    • getName

      public String getName()
      Description copied from class: PipelineInput
      Returns a display name for this input, such as the source's name followed by its format.
      Specified by:
      getName in class PipelineInput
    • toRecord

      public Record toRecord()
      Description copied from interface: RecordSerializable
      Converts this object's state to a record that RecordSerializable.fromRecord(Record) can load.
      Specified by:
      toRecord in interface RecordSerializable
      Overrides:
      toRecord in class PipelineInput
    • fromRecord

      public JdbcPipelineInput fromRecord(Record source)
      Description copied from interface: RecordSerializable
      Loads this instance's state from a record and returns this (for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.
      Specified by:
      fromRecord in interface RecordSerializable
      Overrides:
      fromRecord in class PipelineInput
      Parameters:
      source -
      Returns:
      this instance.
    • getJdbcConnectionFactory

      public JdbcConnectionFactory getJdbcConnectionFactory()
    • setJdbcConnectionFactory

      public JdbcPipelineInput setJdbcConnectionFactory(JdbcConnectionFactory jdbcConnectionFactory)
    • setJdbcConnectionFactory

      public JdbcPipelineInput setJdbcConnectionFactory(Connection connection)
      Uses the given connection for every reader this input creates.
    • setJdbcConnectionFactory

      public JdbcPipelineInput setJdbcConnectionFactory(DataSource dataSource)
      Obtains a new connection from the data source for each reader this input creates.
    • getQuery

      @Deprecated public String getQuery()
      Deprecated.
      Use getQueryString() instead.
    • getQueryString

      public String getQueryString()
    • setQuery

      @Deprecated public JdbcPipelineInput setQuery(String query)
      Deprecated.
    • setQueryString

      public JdbcPipelineInput setQueryString(String queryString)
    • isAutoCloseConnection

      public boolean isAutoCloseConnection()
      Indicates if the database connection is closed when the reader is closed (defaults to false).
    • setAutoCloseConnection

      public JdbcPipelineInput setAutoCloseConnection(boolean autoCloseConnection)
      Indicates if the database connection is closed when the reader is closed (defaults to false).
    • isUseColumnLabel

      public boolean isUseColumnLabel()
      Indicates if column labels (aliases) are used as field names instead of the column names (defaults to false).
    • setUseColumnLabel

      public JdbcPipelineInput setUseColumnLabel(boolean useColumnLabel)
      Indicates if column labels (aliases) are used as field names instead of the column names (defaults to false).
    • getParameters

      public Object[] getParameters()
      Returns the values bound, in order, to the query's ? placeholders or null to run it as a plain statement.
    • setParameters

      public JdbcPipelineInput setParameters(Object[] parameters)
      Sets the values bound, in order, to the query's ? placeholders or null to run it as a plain statement.
    • getParameterSqlTypes

      public int[] getParameterSqlTypes()
      Returns the Types code of each parameter, in the same order, or null to bind them without a type.
    • setParameterSqlTypes

      public JdbcPipelineInput setParameterSqlTypes(int[] parameterSqlTypes)
      Sets the Types code of each parameter, in the same order, or null to bind them without a type.
    • isLineageSupported

      public boolean isLineageSupported()
      Description copied from class: PipelineInput
      Indicates if this input can save data lineage on the records it reads (false unless a subclass overrides it).
      Overrides:
      isLineageSupported in class PipelineInput
    • createDataReader

      public DataReader createDataReader()
    • generateJavaCode

      public void generateJavaCode(JavaCodeBuilder code)
      Description copied from interface: JavaCodeGenerator
      Appends Java source code representing this object to the given builder.
    • toXmlElement

      public Element toXmlElement(Document document)
      Description copied from interface: XmlSerializable
      Returns an element, created with document, describing this object; the default implementation throws a DataException.
      Specified by:
      toXmlElement in interface XmlSerializable
      Overrides:
      toXmlElement in class PipelineInput
    • fromXmlElement

      public JdbcPipelineInput fromXmlElement(Element pipelineInputElement)
      Specified by:
      fromXmlElement in interface XmlSerializable
      Overrides:
      fromXmlElement in class PipelineInput