@Internal public final class TableInsertOrUpdateStatementExecutor extends Object implements JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>
JdbcBatchStatementExecutor that provides upsert semantics by updating row if it exists
and inserting otherwise. Only used in Table/SQL API.| Constructor and Description |
|---|
TableInsertOrUpdateStatementExecutor(StatementFactory existStmtFactory,
StatementFactory insertStmtFactory,
StatementFactory updateStmtFactory,
JdbcRowConverter existSetter,
JdbcRowConverter insertSetter,
JdbcRowConverter updateSetter,
java.util.function.Function<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData> keyExtractor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToBatch(org.apache.flink.table.data.RowData record) |
void |
closeStatements()
Close JDBC related statements.
|
void |
executeBatch()
Submits a batch of commands to the database for execution.
|
void |
prepareStatements(Connection connection)
Create statements from connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitkeyed, simplepublic TableInsertOrUpdateStatementExecutor(StatementFactory existStmtFactory, StatementFactory insertStmtFactory, StatementFactory updateStmtFactory, JdbcRowConverter existSetter, JdbcRowConverter insertSetter, JdbcRowConverter updateSetter, java.util.function.Function<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData> keyExtractor)
public void prepareStatements(Connection connection) throws SQLException
JdbcBatchStatementExecutorprepareStatements in interface JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>SQLExceptionpublic void addToBatch(org.apache.flink.table.data.RowData record)
throws SQLException
addToBatch in interface JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>SQLExceptionpublic void executeBatch()
throws SQLException
JdbcBatchStatementExecutorexecuteBatch in interface JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>SQLExceptionpublic void closeStatements()
throws SQLException
JdbcBatchStatementExecutorcloseStatements in interface JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>SQLExceptionCopyright © 2022–2024 The Apache Software Foundation. All rights reserved.