public abstract class AbstractWriteToJDBC extends JDBCOperator
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractWriteToJDBC.AbstractWriteHelper |
protected static class |
AbstractWriteToJDBC.AbstractWriteToJDBCWorker |
protected static class |
AbstractWriteToJDBC.SqlWriteProperties |
Modifier and Type | Field and Description |
---|---|
protected int |
commitInterval |
protected String |
finalizeTableSQL |
protected String |
initializeTableSQL |
protected RecordPort |
input |
protected int |
isolationLevel |
protected String[] |
keyNames |
protected Map<String,String> |
renameMapping |
Constructor and Description |
---|
AbstractWriteToJDBC() |
AbstractWriteToJDBC(JDBCOperator other) |
Modifier and Type | Method and Description |
---|---|
protected static void |
appendDelimited(StringBuilder command,
String delimiter,
List<String> fields,
String fieldSuffix) |
protected static String |
buildDeleteStatement(String tableName,
List<String> keyFields) |
protected static String |
buildInsertStatement(String tableName,
List<String> fields) |
protected static String |
buildUpdateStatement(String tableName,
List<String> nonKeyFields,
List<String> keyFields) |
protected String |
createDropTableSQL() |
protected String |
createTruncateTableSQL() |
int |
getCommitInterval()
Retrieves the commit interval used by the JDBC driver.
|
String |
getFinalizeTableSQL()
Retrieves the SQL statement to execute after processing all the records.
|
String |
getInitializeTableSQL()
Retrieves the SQL statement to execute before processing any records.
|
RecordPort |
getInput()
Returns the input port.
|
int |
getIsolationLevel()
Retrieves the isolation level to use for the transactions.
|
protected List<String> |
getKeyNameList(List<String> fieldNameList) |
String[] |
getKeyNames()
Retrieves the field names (JDBC column names) to use as keys.
|
Map<String,String> |
getRenameMapping()
Returns the rename mapping.
|
protected String |
guessTableName() |
void |
setCommitInterval(int commitInterval)
Sets the commit interval used by the JDBC driver.
|
void |
setFinalizeTableSQL(String finalizeTableSQL)
Sets the SQL statement to execute after processing all the records.
|
void |
setInitializeTableSQL(String initializeTableSQL)
Sets the SQL statement to execute before processing any records.
|
void |
setIsolationLevel(int level)
Sets the isolation level to use for the transactions.
|
void |
setKeyNames(String[] keyNames)
Sets the field names (JDBC column names) to use as keys.
|
void |
setRenameMapping(Map<String,String> renameMapping)
Sets a rename mapping.
|
getConnectionFactory, getDriverName, getErrorAction, getHostNames, getJDBCConnector, getPassword, getSqlWarningLimit, getTableName, getUrl, getUser, setConnectionFactory, setDriverName, setErrorAction, setHostNames, setHostNames, setJDBCConnector, setPassword, setSqlWarningLimit, setTableName, setUrl, setUser
compose
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
protected final RecordPort input
protected String[] keyNames
protected int commitInterval
protected int isolationLevel
protected String initializeTableSQL
protected String finalizeTableSQL
public AbstractWriteToJDBC()
public AbstractWriteToJDBC(JDBCOperator other)
public String[] getKeyNames()
public void setKeyNames(String[] keyNames)
#outputMode
is
OutputMode#UPDATE
or OutputMode#DELETE
.keyNames
- the list of key name fieldspublic int getIsolationLevel()
public void setIsolationLevel(int level)
Connection.setTransactionIsolation(int)
for isolation level explanations.level
- the isolation level to use for the transactionspublic int getCommitInterval()
public void setCommitInterval(int commitInterval)
commitInterval
- number of operations executed between commitspublic String getInitializeTableSQL()
public void setInitializeTableSQL(String initializeTableSQL)
CREATE TABLE
statement.
This statement is executed only once, regardless of #partitionCount
.
initializeTableSQL
- the SQL statement to execute before processing any recordspublic String getFinalizeTableSQL()
public void setFinalizeTableSQL(String finalizeTableSQL)
CREATE INDEX
statement.
This statement is executed only once, regardless of #partitionCount
.
finalizeTableSQL
- the SQL statement to execute after processing all the recordspublic Map<String,String> getRenameMapping()
public void setRenameMapping(Map<String,String> renameMapping)
renameMapping
- the mapping from old to new names.public RecordPort getInput()
protected static String buildInsertStatement(String tableName, List<String> fields)
protected static String buildUpdateStatement(String tableName, List<String> nonKeyFields, List<String> keyFields)
protected static String buildDeleteStatement(String tableName, List<String> keyFields)
protected static void appendDelimited(StringBuilder command, String delimiter, List<String> fields, String fieldSuffix)
protected String createTruncateTableSQL()
protected String createDropTableSQL()
protected String guessTableName()
Copyright © 2016 Actian Corporation. All rights reserved.