public class JdbcCollectionReader
extends CollectionReader_ImplBase
Modifier and Type | Field and Description |
---|---|
private int |
currRowCount |
private int |
docColType |
private java.lang.String |
docColTypeName |
private java.lang.String[] |
docIdColNames |
private java.lang.String |
docIdDelimiter |
private java.lang.String |
docTextColName |
private Logger |
logger |
static java.lang.String |
PARAM_DB_CONN_RESRC
Name of external resource for database connection.
|
static java.lang.String |
PARAM_DOCID_COLS
Optional parameter.
|
static java.lang.String |
PARAM_DOCID_DELIMITER
Optional parameter.
|
static java.lang.String |
PARAM_DOCTEXT_COL
Name of column from resultset that contains the document text.
|
static java.lang.String |
PARAM_SQL
SQL statement to retrieve the document.
|
static java.lang.String |
PARAM_VALUE_FILE_RESRC
Optional parameter.
|
private java.util.List<java.lang.String>[] |
prepStmtValArr |
private int |
prepStmtValArrIdx |
private java.sql.PreparedStatement |
queryPrepStmt |
private java.sql.ResultSet |
rs |
private int |
totalRowCount |
private boolean |
usePrepStmtVals |
Constructor and Description |
---|
JdbcCollectionReader() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private java.lang.String |
convertToString(java.sql.Clob clob)
Loads the clob data into a String object.
|
private java.lang.String |
getDocumentID(java.sql.ResultSet rs)
Builds a document ID from one or more pieces of query data.
|
void |
getNext(CAS cas) |
Progress[] |
getProgress() |
private int |
getRowCount(java.sql.Connection conn,
java.lang.String querySql)
Slice up the query SQL and rebuild a SQL statement that gets a row count;
|
boolean |
hasNext() |
void |
initialize() |
private void |
loadValueFile(java.io.File valueFile)
Loads the prepared statement value file.
|
private void |
setPrepStmtValues(java.sql.PreparedStatement prepStmt,
java.util.List<java.lang.String> valList)
Helper method that sets the prepared statement values.
|
private Logger logger
public static final java.lang.String PARAM_SQL
public static final java.lang.String PARAM_DOCTEXT_COL
public static final java.lang.String PARAM_DB_CONN_RESRC
public static final java.lang.String PARAM_DOCID_COLS
public static final java.lang.String PARAM_DOCID_DELIMITER
public static final java.lang.String PARAM_VALUE_FILE_RESRC
private java.sql.PreparedStatement queryPrepStmt
private java.sql.ResultSet rs
private java.lang.String docTextColName
private int docColType
private java.lang.String docColTypeName
private java.lang.String[] docIdColNames
private java.lang.String docIdDelimiter
private int totalRowCount
private int currRowCount
private java.util.List<java.lang.String>[] prepStmtValArr
private int prepStmtValArrIdx
private boolean usePrepStmtVals
public void initialize() throws ResourceInitializationException
ResourceInitializationException
private void loadValueFile(java.io.File valueFile) throws java.io.IOException
valueFile
- java.io.IOException
private int getRowCount(java.sql.Connection conn, java.lang.String querySql) throws java.sql.SQLException
querySql
- java.sql.SQLException
private void setPrepStmtValues(java.sql.PreparedStatement prepStmt, java.util.List<java.lang.String> valList) throws java.sql.SQLException
prepStmt
- valList
- java.sql.SQLException
public void getNext(CAS cas) throws java.io.IOException, CollectionException
java.io.IOException
CollectionException
private java.lang.String getDocumentID(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- java.sql.SQLException
private java.lang.String convertToString(java.sql.Clob clob) throws java.sql.SQLException, java.io.IOException
clob
- java.sql.SQLException
java.io.IOException
public boolean hasNext() throws java.io.IOException, CollectionException
java.io.IOException
CollectionException
public Progress[] getProgress()
public void close() throws java.io.IOException
java.io.IOException