Class JdbcPipelineOutput
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineOutput
com.northconcepts.datapipeline.foundations.pipeline.output.JdbcPipelineOutput
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,DataWriterFactory,JavaCodeGenerator,Serializable
Writes a pipeline's records to a database table using a
JdbcWriter.- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element pipelineOutputElement) voidAppends Java source code representing this object to the given builder.intReturns the number of records sent per batch update; 1 or less turns batching off (defaults to -1).getJdbcType(String fieldName) Returns the JDBC type set for the field withsetJdbcType(String, int)or null if there is none.getName()Returns a display name for this output, such as the destination's name followed by its format.getTable()Deprecated.booleanIndicates if the database connection is closed when the writer is closed (defaults to false).booleanIndicates if commit is called after every batch instead of only after the last one (defaults to false).setAutoCloseConnection(boolean autoCloseConnection) Indicates if the database connection is closed when the writer is closed (defaults to false).setBatchSize(int batchSize) Sets the number of records sent per batch update; 1 or less turns batching off (defaults to -1).setCommitBatch(boolean commitBatch) Indicates if commit is called after every batch instead of only after the last one (defaults to false).setJdbcConnectionFactory(JdbcConnectionFactory jdbcConnectionFactory) setJdbcConnectionFactory(Connection connection) Uses the given connection for every writer this output creates.setJdbcConnectionFactory(DataSource dataSource) Obtains a new connection from the data source for each writer this output creates.setJdbcType(String fieldName, int jdbcType) The given Java object will be converted to the given targetSqlType before being sent to the database.Deprecated.UsesetTableName(String)instead.setTableName(String tableName) toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.PipelineOutput
getNestedPipelineOutput, getPipelineOutput, getRootPipelineOutputMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties
-
Constructor Details
-
JdbcPipelineOutput
public JdbcPipelineOutput()
-
-
Method Details
-
getName
Description copied from class:PipelineOutputReturns a display name for this output, such as the destination's name followed by its format.- Specified by:
getNamein classPipelineOutput
-
setJdbcType
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
Returns the JDBC type set for the field withsetJdbcType(String, int)or null if there is none. -
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classBean
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classPipelineOutput- Parameters:
source-- Returns:
- this instance.
-
getJdbcConnectionFactory
-
setJdbcConnectionFactory
-
setJdbcConnectionFactory
Uses the given connection for every writer this output creates. -
setJdbcConnectionFactory
Obtains a new connection from the data source for each writer this output creates. -
getTable
Deprecated.UsegetTableName()instead. -
getTableName
-
setTable
Deprecated.UsesetTableName(String)instead. -
setTableName
-
isAutoCloseConnection
public boolean isAutoCloseConnection()Indicates if the database connection is closed when the writer is closed (defaults to false). -
setAutoCloseConnection
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
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
Indicates if commit is called after every batch instead of only after the last one (defaults to false). -
generateJavaCode
Description copied from interface:JavaCodeGeneratorAppends Java source code representing this object to the given builder. -
createDataWriter
-
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable- Overrides:
toXmlElementin classPipelineOutput
-
fromXmlElement
-
getTableName()instead.