|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.northconcepts.datapipeline.core.DataEndpoint
com.northconcepts.datapipeline.core.DataReader
com.northconcepts.datapipeline.jdbc.JdbcReader
public class JdbcReader
Obtains records from a database query.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
DataEndpoint.State |
| Field Summary | |
|---|---|
protected Record |
currentRecord
|
| Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
BUFFER_SIZE, log |
| Constructor Summary | |
|---|---|
JdbcReader(Connection connection,
String queryString)
|
|
JdbcReader(Connection connection,
String queryString,
Object... parameters)
|
|
JdbcReader(Connection connection,
String queryString,
Object[] parameters,
int[] parameterSqlTypes)
|
|
| Method Summary | |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a DataException. |
void |
close()
Indicates that this endpoint has finished reading or writing. |
boolean |
getAutoCloseConnection()
|
JdbcValueReader |
getValueReader()
|
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)
|
JdbcReader |
setValueReader(JdbcValueReader valueReader)
|
| Methods inherited from class com.northconcepts.datapipeline.core.DataReader |
|---|
available, getBufferSize, getNestedReader, getRootReader, peek, pop, push, skip |
| Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getDescription, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, setDescription, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Record currentRecord
| Constructor Detail |
|---|
public JdbcReader(Connection connection,
String queryString)
public JdbcReader(Connection connection,
String queryString,
Object... parameters)
public JdbcReader(Connection connection,
String queryString,
Object[] parameters,
int[] parameterSqlTypes)
| Method Detail |
|---|
public boolean getAutoCloseConnection()
public JdbcReader setAutoCloseConnection(boolean closeConnection)
public JdbcValueReader getValueReader()
public JdbcReader setValueReader(JdbcValueReader valueReader)
public DataException addExceptionProperties(DataException exception)
DataEndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.
addExceptionProperties in class DataReader
public 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 writing will be converted to a DataException using DataEndpoint.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.
If no record is available, null will be returned.
readImpl in class DataReaderThrowablepublic void open()
DataEndpoint
open in class DataEndpointpublic void close()
DataEndpoint
close in class DataEndpoint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||