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

public class JdbcPipelineOutput extends PipelineOutput
Writes a pipeline's records to a database table using a JdbcWriter.
See Also:
  • Constructor Details

    • JdbcPipelineOutput

      public JdbcPipelineOutput()
  • Method Details

    • getName

      public String getName()
      Description copied from class: PipelineOutput
      Returns a display name for this output, such as the destination's name followed by its format.
      Specified by:
      getName in class PipelineOutput
    • setJdbcType

      public JdbcPipelineOutput setJdbcType(String fieldName, int jdbcType)

      The given Java object will be converted to the given targetSqlType before being sent to the database.

      Note that this method may be used to pass database-specific abstract data types.

      Parameters:
      fieldName -
      jdbcType - - the object containing the JDBC Type parameter value
    • getJdbcType

      public Integer getJdbcType(String fieldName)
      Returns the JDBC type set for the field with setJdbcType(String, int) or null if there is none.
    • 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 Bean
    • fromRecord

      public JdbcPipelineOutput 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 PipelineOutput
      Parameters:
      source -
      Returns:
      this instance.
    • getJdbcConnectionFactory

      public JdbcConnectionFactory getJdbcConnectionFactory()
    • setJdbcConnectionFactory

      public JdbcPipelineOutput setJdbcConnectionFactory(JdbcConnectionFactory jdbcConnectionFactory)
    • setJdbcConnectionFactory

      public JdbcPipelineOutput setJdbcConnectionFactory(Connection connection)
      Uses the given connection for every writer this output creates.
    • setJdbcConnectionFactory

      public JdbcPipelineOutput setJdbcConnectionFactory(DataSource dataSource)
      Obtains a new connection from the data source for each writer this output creates.
    • getTable

      @Deprecated public String getTable()
      Deprecated.
      Use getTableName() instead.
    • getTableName

      public String getTableName()
    • setTable

      @Deprecated public JdbcPipelineOutput setTable(String table)
      Deprecated.
    • setTableName

      public JdbcPipelineOutput setTableName(String tableName)
    • isAutoCloseConnection

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

      public JdbcPipelineOutput setAutoCloseConnection(boolean autoCloseConnection)
      Indicates if the database connection is closed when the writer is closed (defaults to false).
    • getBatchSize

      public int getBatchSize()
      Returns the number of records sent per batch update; 1 or less turns batching off (defaults to -1).
    • setBatchSize

      public JdbcPipelineOutput setBatchSize(int batchSize)
      Sets the number of records sent per batch update; 1 or less turns batching off (defaults to -1).
    • isCommitBatch

      public boolean isCommitBatch()
      Indicates if commit is called after every batch instead of only after the last one (defaults to false).
    • setCommitBatch

      public JdbcPipelineOutput setCommitBatch(boolean commitBatch)
      Indicates if commit is called after every batch instead of only after the last one (defaults to false).
    • generateJavaCode

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

      public DataWriter createDataWriter()
    • 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 PipelineOutput
    • fromXmlElement

      public JdbcPipelineOutput fromXmlElement(Element pipelineOutputElement)