public class JDBCOutputFormat extends AbstractJDBCOutputFormat<Row>
Row
,
DriverManager
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
JDBCOutputFormat.JDBCOutputFormatBuilder
Builder for a
JDBCOutputFormat . |
connection, dbURL
Constructor and Description |
---|
JDBCOutputFormat(String username,
String password,
String drivername,
String dbURL,
String query,
int batchInterval,
int[] typesArray) |
Modifier and Type | Method and Description |
---|---|
static JDBCOutputFormat.JDBCOutputFormatBuilder |
buildJDBCOutputFormat() |
void |
close()
Executes prepared statement and closes all resources of this instance.
|
void |
open(int taskNumber,
int numTasks)
Connects to the target database and initializes the prepared statement.
|
void |
writeRecord(Row row)
Adds a record to the output.
|
closeDbConnection, configure, establishConnection
getRuntimeContext, setRuntimeContext
public void open(int taskNumber, int numTasks) throws IOException
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.IOException
- Thrown, if the output could not be opened due to an
I/O problem.public void writeRecord(Row row) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
row
- The records to add to the output.IOException
- Thrown, if the records could not be added to to an I/O problem.public void close() throws IOException
IOException
- Thrown, if the input could not be closed properly.public static JDBCOutputFormat.JDBCOutputFormatBuilder buildJDBCOutputFormat()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.