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 void
addAllCharacters(String s, ContentHandler handler)
protected Blob
getBlob(ResultSet resultSet, int columnIndex, Metadata metadata)
List<String>
getHeaders()
String
getTableName()
protected void
handleBlob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context)
protected void
handleClob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context)
protected void
handleDate(ResultSet resultSet, int columnIndex, ContentHandler handler)
protected void
handleInteger(ResultSet rs, int columnIndex, ContentHandler handler)
protected void
handleTimeStamp(ResultSet resultSet, int columnIndex, ContentHandler handler)
boolean
nextRow(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:
IOException
SAXException
-
getHeaders
public List<String> getHeaders() throws IOException
- Throws:
IOException
-
handleInteger
protected void handleInteger(ResultSet rs, int columnIndex, ContentHandler handler) throws SQLException, SAXException
- Throws:
SQLException
SAXException
-
handleClob
protected void handleClob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context) throws SQLException, IOException, SAXException
- Throws:
SQLException
IOException
SAXException
-
handleBlob
protected void handleBlob(String tableName, String columnName, int rowNum, ResultSet resultSet, int columnIndex, ContentHandler handler, ParseContext context) throws SQLException, IOException, SAXException
- Throws:
SQLException
IOException
SAXException
-
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
null
if the value was null - Throws:
SQLException
-
handleDate
protected void handleDate(ResultSet resultSet, int columnIndex, ContentHandler handler) throws SAXException, SQLException
- Throws:
SAXException
SQLException
-
handleTimeStamp
protected void handleTimeStamp(ResultSet resultSet, int columnIndex, ContentHandler handler) throws SAXException, SQLException
- Throws:
SAXException
SQLException
-
addAllCharacters
protected void addAllCharacters(String s, ContentHandler handler) throws SAXException
- Throws:
SAXException
-
getTableName
public String getTableName()
-
-