public class JDBCInputFormat extends GenericInputFormat implements 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 |
partitionNumber| Constructor and Description |
|---|
JDBCInputFormat()
Creates a non-configured JDBCInputFormat.
|
JDBCInputFormat(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(Configuration parameters)
Configures this JDBCInputFormat.
|
Record |
nextRecord(Record record)
Stores the next resultSet row in a Record
|
boolean |
reachedEnd()
Checks whether all data has been read.
|
close, createInputSplits, getInputSplitAssigner, getStatistics, openpublic 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(Configuration parameters, String query)
parameters - Configuration with all connection parameters.query - Query to execute.public void configure(Configuration parameters)
configure in interface InputFormat<Record,GenericInputSplit>configure in class GenericInputFormat<Record>parameters - Configuration containing all or no parameters.public boolean reachedEnd()
reachedEnd in interface InputFormat<Record,GenericInputSplit>public Record nextRecord(Record record)
nextRecord in interface InputFormat<Record,GenericInputSplit>record - target RecordCopyright © 2015 The Apache Software Foundation. All rights reserved.