Package org.apache.tika.parser.jdbc
Class JDBCTableReader
- java.lang.Object
-
- org.apache.tika.parser.jdbc.JDBCTableReader
-
- Direct Known Subclasses:
SQLite3TableReader
public class JDBCTableReader extends Object
General base class to iterate through rows of a JDBC table
-
-
Constructor Summary
Constructors Constructor Description JDBCTableReader(Connection connection, String tableName, EmbeddedDocumentUtil embeddedDocumentUtil)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAllCharacters(String s, ContentHandler handler)protected BlobgetBlob(ResultSet resultSet, int columnIndex, Metadata metadata)List<String>getHeaders()StringgetTableName()protected voidhandleBlob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context)protected voidhandleClob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context)protected voidhandleDate(ResultSet resultSet, int columnIndex, ContentHandler handler)protected voidhandleInteger(ResultSet rs, int columnIndex, ContentHandler handler)protected voidhandleTimeStamp(ResultSet resultSet, int columnIndex, ContentHandler handler)booleannextRow(ContentHandler handler, ParseContext context)
-
-
-
Constructor Detail
-
JDBCTableReader
public JDBCTableReader(Connection connection, String tableName, EmbeddedDocumentUtil embeddedDocumentUtil)
-
-
Method Detail
-
nextRow
public boolean nextRow(ContentHandler handler, ParseContext context) throws IOException, SAXException
- Throws:
IOExceptionSAXException
-
getHeaders
public List<String> getHeaders() throws IOException
- Throws:
IOException
-
handleInteger
protected void handleInteger(ResultSet rs, int columnIndex, ContentHandler handler) throws SQLException, SAXException
- Throws:
SQLExceptionSAXException
-
handleClob
protected void handleClob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context) throws SQLException, IOException, SAXException
- Throws:
SQLExceptionIOExceptionSAXException
-
handleBlob
protected void handleBlob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context) throws SQLException, IOException, SAXException
- Throws:
SQLExceptionIOExceptionSAXException
-
getBlob
protected Blob getBlob(ResultSet resultSet, int columnIndex, Metadata metadata) throws SQLException
- Parameters:
resultSet- result set to grab value fromcolumnIndex- index in result setmetadata- metadata to populate or use for each implementation- Returns:
- the blob or
nullif the value was null - Throws:
SQLException
-
handleDate
protected void handleDate(ResultSet resultSet, int columnIndex, ContentHandler handler) throws SAXException, SQLException
- Throws:
SAXExceptionSQLException
-
handleTimeStamp
protected void handleTimeStamp(ResultSet resultSet, int columnIndex, ContentHandler handler) throws SAXException, SQLException
- Throws:
SAXExceptionSQLException
-
addAllCharacters
protected void addAllCharacters(String s, ContentHandler handler) throws SAXException
- Throws:
SAXException
-
getTableName
public String getTableName()
-
-