public class JdbcReader extends DataReader
DataEndpoint.State| Modifier and Type | Field and Description |
|---|---|
protected Record |
currentRecord |
fieldLineage, recordLineagelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
JdbcReader(Connection connection,
String queryString)
Creates a new instance with the
autoCloseConnection property set to false. |
JdbcReader(Connection connection,
String queryString,
Object... parameters)
Creates a new instance with the
autoCloseConnection property set to false. |
JdbcReader(Connection connection,
String queryString,
Object[] parameters,
int[] parameterSqlTypes)
Creates a new instance with the
autoCloseConnection property set to false. |
JdbcReader(JdbcConnectionFactory factory,
String queryString)
Creates a new instance with the
autoCloseConnection property set to true. |
JdbcReader(JdbcConnectionFactory factory,
String queryString,
Object... parameters)
Creates a new instance with the
autoCloseConnection property set to true. |
JdbcReader(JdbcConnectionFactory factory,
String queryString,
Object[] parameters,
int[] parameterSqlTypes)
Creates a new instance with the
autoCloseConnection property set to true. |
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
protected Record |
addLineage(Record record) |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
boolean |
getAutoCloseConnection()
Indicates if the database connection in this endpoint should be closed when the endpoint is closed.
|
Integer |
getFetchSize()
The fetch size to set on the
Statement using Statement.setFetchSize(int) or null if the connection's default should be used (default null). |
boolean |
getUseColumnLabel() |
JdbcValueReader |
getValueReader() |
boolean |
isLineageSupported() |
boolean |
isStrictTypeMapping()
Indicates if database types should be mapped to java type based only on
java.sql.Types as defined by Sun/Oracle (defaults to false). |
void |
open()
Makes this endpoint ready for reading or writing.
|
Record |
read()
Reads the next record from this
DataReader and increases the record-count by 1. |
protected Record |
readImpl()
Overridden by subclasses to read the next record from this
DataReader. |
JdbcReader |
setAutoCloseConnection(boolean closeConnection)
Indicates if the database connection in this endpoint should be closed when the endpoint is closed.
|
JdbcReader |
setFetchSize(Integer fetchSize)
The fetch size to set on the
Statement using Statement.setFetchSize(int) or null if the connection's default should be used (default null). |
JdbcReader |
setSaveLineage(boolean saveLineage) |
JdbcReader |
setStrictTypeMapping(boolean strictTypeMapping)
Indicates if database types should be mapped to java type based only on
java.sql.Types as defined by Sun/Oracle (defaults to false). |
JdbcReader |
setUseColumnLabel(boolean useColumnLabel)
When set to
true, column labels (or aliases) will be used for field names instead
of the underlying, real column names. |
JdbcReader |
setValueReader(JdbcValueReader valueReader) |
available, getBufferSize, getNestedEndpoint, getNestedReader, getReader, getRootEndpoint, getRootReader, isExhausted, isSaveLineage, peek, pop, push, skipdecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionprotected Record currentRecord
public JdbcReader(Connection connection, String queryString)
autoCloseConnection property set to false.connection - queryString - public JdbcReader(Connection connection, String queryString, Object... parameters)
autoCloseConnection property set to false.connection - queryString - parameters - public JdbcReader(Connection connection, String queryString, Object[] parameters, int[] parameterSqlTypes)
autoCloseConnection property set to false.connection - queryString - parameters - parameterSqlTypes - public JdbcReader(JdbcConnectionFactory factory, String queryString) throws DataException
autoCloseConnection property set to true.factory - queryString - DataExceptionpublic JdbcReader(JdbcConnectionFactory factory, String queryString, Object... parameters)
autoCloseConnection property set to true.factory - queryString - parameters - public JdbcReader(JdbcConnectionFactory factory, String queryString, Object[] parameters, int[] parameterSqlTypes)
autoCloseConnection property set to true.factory - queryString - parameters - parameterSqlTypes - public boolean getAutoCloseConnection()
false
if this instance was constructed with a Connection or true if constructed with a JdbcConnectionFactory.public JdbcReader setAutoCloseConnection(boolean closeConnection)
false
if this instance was constructed with a Connection or true if constructed with a JdbcConnectionFactory.public JdbcValueReader getValueReader()
public JdbcReader setValueReader(JdbcValueReader valueReader)
public boolean getUseColumnLabel()
public Integer getFetchSize()
Statement using Statement.setFetchSize(int) or null if the connection's default should be used (default null).public JdbcReader setFetchSize(Integer fetchSize)
Statement using Statement.setFetchSize(int) or null if the connection's default should be used (default null).public JdbcReader setUseColumnLabel(boolean useColumnLabel)
true, column labels (or aliases) will be used for field names instead
of the underlying, real column names. Defaults to false.public JdbcReader setSaveLineage(boolean saveLineage)
setSaveLineage in class DataReaderpublic boolean isStrictTypeMapping()
java.sql.Types as defined by Sun/Oracle (defaults to false).
Otherwise, the column display size and scale will be considered for numeric types.public JdbcReader setStrictTypeMapping(boolean strictTypeMapping)
java.sql.Types as defined by Sun/Oracle (defaults to false).
Otherwise, the column display size and scale will be considered for numeric types.public DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class DataReaderpublic Record read() throws DataException
DataReaderDataReader and increases the record-count by 1.
This method will first read any pushed (DataReader.push(Record)) records before reading from the underlying source.
If no record is available, null will be returned. This method blocks until a record is available,
the end of the stream is reached, or an exception is thrown.
Any exception raised while reading will be converted to a DataException using DataObject.exception(Throwable).
Subclasses generally do not need to override this method, instead they should implement DataReader.readImpl().
read in class DataReaderDataExceptionDataReader.push(Record),
DataReader.peek(int),
DataReader.read()protected Record readImpl() throws Throwable
DataReaderDataReader. The default
implementation of DataReader.read() now insures that this method will not be called again after it returns
a null.
If no record is available, null will be returned.
readImpl in class DataReaderThrowablepublic boolean isLineageSupported()
isLineageSupported in class DataReaderprotected Record addLineage(Record record)
addLineage in class DataReaderpublic void open()
DataEndpointopen in class DataEndpointpublic void close()
DataEndpointclose in class DataEndpointCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.