Class TableSimpleStatementExecutor
- java.lang.Object
-
- org.apache.flink.connector.jdbc.internal.executor.TableSimpleStatementExecutor
-
- All Implemented Interfaces:
JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>
public final class TableSimpleStatementExecutor extends Object implements JdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>
AJdbcBatchStatementExecutorthat simply adds the records into batches ofPreparedStatementand doesn't buffer records in memory. Only used in Table/SQL API.
-
-
Constructor Summary
Constructors Constructor Description TableSimpleStatementExecutor(StatementFactory stmtFactory, JdbcRowConverter converter)Keep in mind object reuse: if it's on then key extractor may be required to return new object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToBatch(org.apache.flink.table.data.RowData record)voidcloseStatements()Close JDBC related statements.voidexecuteBatch()Submits a batch of commands to the database for execution.voidprepareStatements(Connection connection)Create statements from connection.
-
-
-
Constructor Detail
-
TableSimpleStatementExecutor
public TableSimpleStatementExecutor(StatementFactory stmtFactory, JdbcRowConverter converter)
Keep in mind object reuse: if it's on then key extractor may be required to return new object.
-
-
Method Detail
-
prepareStatements
public void prepareStatements(Connection connection) throws SQLException
Description copied from interface:JdbcBatchStatementExecutorCreate statements from connection.- Specified by:
prepareStatementsin interfaceJdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>- Throws:
SQLException
-
addToBatch
public void addToBatch(org.apache.flink.table.data.RowData record) throws SQLException- Specified by:
addToBatchin interfaceJdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>- Throws:
SQLException
-
executeBatch
public void executeBatch() throws SQLExceptionDescription copied from interface:JdbcBatchStatementExecutorSubmits a batch of commands to the database for execution.- Specified by:
executeBatchin interfaceJdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>- Throws:
SQLException
-
closeStatements
public void closeStatements() throws SQLExceptionDescription copied from interface:JdbcBatchStatementExecutorClose JDBC related statements.- Specified by:
closeStatementsin interfaceJdbcBatchStatementExecutor<org.apache.flink.table.data.RowData>- Throws:
SQLException
-
-