public class JDBCInputFormat
extends org.apache.flink.api.java.record.io.GenericInputFormat
implements org.apache.flink.api.common.io.NonParallelInput
Configuration The position of a value inside a Record is
determined by the table
returned.Configuration,
Record,
DriverManager,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
JDBCInputFormat.NotTransformableSQLFieldException |
| Modifier and Type | Field and Description |
|---|---|
String |
DRIVER_KEY |
String |
PASSWORD_KEY |
String |
QUERY_KEY |
String |
URL_KEY |
String |
USERNAME_KEY |
| Constructor and Description |
|---|
JDBCInputFormat()
Creates a non-configured JDBCInputFormat.
|
JDBCInputFormat(org.apache.flink.configuration.Configuration parameters,
String query)
Creates a JDBCInputFormat and configures it.
|
JDBCInputFormat(String driverName,
String dbURL,
String query)
Creates a JDBCInputFormat and configures it.
|
JDBCInputFormat(String driverName,
String dbURL,
String username,
String password,
String query)
Creates a JDBCInputFormat and configures it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.flink.configuration.Configuration parameters)
Configures this JDBCInputFormat.
|
org.apache.flink.types.Record |
nextRecord(org.apache.flink.types.Record record)
Stores the next resultSet row in a Record
|
boolean |
reachedEnd()
Checks whether all data has been read.
|
public final String DRIVER_KEY
public final String USERNAME_KEY
public final String PASSWORD_KEY
public final String URL_KEY
public final String QUERY_KEY
public JDBCInputFormat()
public JDBCInputFormat(String driverName, String dbURL, String username, String password, String query)
driverName - JDBC-DrivenamedbURL - Formatted URL containing all connection parameters.username - password - query - Query to execute.public JDBCInputFormat(String driverName, String dbURL, String query)
driverName - JDBC-DrivernamedbURL - Formatted URL containing all connection parameters.query - Query to execute.public JDBCInputFormat(org.apache.flink.configuration.Configuration parameters,
String query)
parameters - Configuration with all connection parameters.query - Query to execute.public void configure(org.apache.flink.configuration.Configuration parameters)
configure in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.io.GenericInputSplit>configure in class org.apache.flink.api.common.io.GenericInputFormat<org.apache.flink.types.Record>parameters - Configuration containing all or no parameters.public boolean reachedEnd()
reachedEnd in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.io.GenericInputSplit>public org.apache.flink.types.Record nextRecord(org.apache.flink.types.Record record)
nextRecord in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.io.GenericInputSplit>record - target RecordCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.