public final class UpdateInJDBC extends AbstractWriteToJDBC implements RecordPipelineOperator
Key fields
must be
specified in the operator properties. Key field values will be used within
generated database update statements. The updated fields may also be optionally
set using setUpdateFields(String[])
. If unset will use all fields
not already used as key fields.
Initial
and
final
SQL
statements can be provided. The initial statement is run before any input
data is handled. The final statement is executed after all input data has
been processed.
Note that the UpdateInJDBC
operator is parallelized. Each parallel
instance will open a separate connection to the target database. To limit the
number of database connections used by this operator, tune down the operator parallelism level.
To set the parallelism level create an OperatorSettings
instance with
maximum parallelism set to the wanted level. The operator settings can then be
passed as a parameter to the
LogicalGraph#add(com.pervasive.datarush.operators.LogicalOperator, OperatorSettings)
method.AbstractWriteToJDBC.AbstractWriteHelper, AbstractWriteToJDBC.AbstractWriteToJDBCWorker, AbstractWriteToJDBC.SqlWriteProperties
commitInterval, finalizeTableSQL, initializeTableSQL, input, isolationLevel, keyNames, renameMapping
Constructor and Description |
---|
UpdateInJDBC()
Default constructor.
|
UpdateInJDBC(UpdateInJDBC other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
compose(CompositionContext ctx)
Compose the body of this operator.
|
RecordPort |
getOutput()
Get the output port containing the statuses received from the database.
|
String |
getStatusField()
Get the name of the field that will contain the update status.
|
String[] |
getUpdateFields()
Get the names of the fields that will be updated.
|
void |
setStatusField(String statusField)
Set the name of the field that will contain the update status.
|
void |
setUpdateFields(String[] updateFields)
Set the names of the fields that will be updated.
|
appendDelimited, buildDeleteStatement, buildInsertStatement, buildUpdateStatement, createDropTableSQL, createTruncateTableSQL, getCommitInterval, getFinalizeTableSQL, getInitializeTableSQL, getInput, getIsolationLevel, getKeyNameList, getKeyNames, getRenameMapping, guessTableName, setCommitInterval, setFinalizeTableSQL, setInitializeTableSQL, setIsolationLevel, setKeyNames, setRenameMapping
getConnectionFactory, getDriverName, getErrorAction, getHostNames, getJDBCConnector, getPassword, getSqlWarningLimit, getTableName, getUrl, getUser, setConnectionFactory, setDriverName, setErrorAction, setHostNames, setHostNames, setJDBCConnector, setPassword, setSqlWarningLimit, setTableName, setUrl, setUser
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInput
disableParallelism, getInputPorts, getOutputPorts
public UpdateInJDBC()
public UpdateInJDBC(UpdateInJDBC other)
other
- the other instance of WriteToJDBC
public void setStatusField(String statusField)
statusField
- name of the status field in the outputpublic String getStatusField()
public void setUpdateFields(String[] updateFields)
updateFields
- names of the fields that will be updatedpublic String[] getUpdateFields()
public RecordPort getOutput()
getOutput
in interface PipelineOperator<RecordPort>
protected void compose(CompositionContext ctx)
CompositeOperator
OperatorComposable.add(O)
OperatorComposable.connect(P, P)
. This includes
connections from the composite's input ports to sub-operators, connections between sub-operators, and
connections from sub-operators output ports to the composite's output portscompose
in class CompositeOperator
ctx
- the contextCopyright © 2016 Actian Corporation. All rights reserved.