Package org.apache.tika.parser.sqlite3
Class SQLite3DBParser
java.lang.Object
org.apache.tika.parser.jdbc.AbstractDBParser
org.apache.tika.parser.sqlite3.SQLite3DBParser
- All Implemented Interfaces:
Serializable
,Parser
This is the implementation of the db parser for SQLite.
This parser is internal only; it should not be registered in the services
file or configured in the TikaConfig xml file.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Override this for any special handling of closing the connection.protected void
extractMetadata
(Connection connection, Metadata metadata) This is called before parsing the tables to extract metadata from the db, if any.protected Connection
getConnection
(InputStream stream, Metadata metadata, ParseContext context) Override this for special configuration of the connection, such as limiting the number of rows to be held in memory.protected String
getConnectionString
(InputStream is, Metadata metadata, ParseContext context) Implement for db specific connection information, e.g.protected String
JDBC class name, e.g. org.sqlite.JDBCgetSupportedTypes
(ParseContext context) Returns the set of media types supported by this parser when used with the given parse context.getTableNames
(Connection connection, Metadata metadata, ParseContext context) Returns the names of the tables to processprotected JDBCTableReader
getTableReader
(Connection connection, String tableName, EmbeddedDocumentUtil embeddedDocumentUtil) Given a connection and a table name, return the JDBCTableReader for this db.getTableReader
(Connection connection, String tableName, ParseContext context) Given a connection and a table name, return the JDBCTableReader for this db.Methods inherited from class org.apache.tika.parser.jdbc.AbstractDBParser
parse
-
Field Details
-
SQLITE_CLASS_NAME
- See Also:
-
METADATA_KEYS
-
-
Constructor Details
-
SQLite3DBParser
public SQLite3DBParser()
-
-
Method Details
-
getSupportedTypes
Description copied from interface:Parser
Returns the set of media types supported by this parser when used with the given parse context.- Specified by:
getSupportedTypes
in interfaceParser
- Overrides:
getSupportedTypes
in classAbstractDBParser
- Parameters:
context
- context- Returns:
- null (always)
-
getConnection
protected Connection getConnection(InputStream stream, Metadata metadata, ParseContext context) throws IOException Description copied from class:AbstractDBParser
Override this for special configuration of the connection, such as limiting the number of rows to be held in memory.- Overrides:
getConnection
in classAbstractDBParser
- Parameters:
stream
- stream to usemetadata
- metadata that could be used in parameterizing the connectioncontext
- parsecontext that could be used in parameterizing the connection- Returns:
- connection
- Throws:
IOException
-
getConnectionString
protected String getConnectionString(InputStream is, Metadata metadata, ParseContext context) throws IOException Description copied from class:AbstractDBParser
Implement for db specific connection information, e.g. "jdbc:sqlite:/docs/mydb.db" Include any optimization settings, user name, password, etc.- Specified by:
getConnectionString
in classAbstractDBParser
- Parameters:
is
- stream for processingmetadata
- metadata might be useful in determining connection infocontext
- context to use to help create connectionString- Returns:
- connection string to be used by
AbstractDBParser.getConnection(java.io.InputStream, org.apache.tika.metadata.Metadata, org.apache.tika.parser.ParseContext)
. - Throws:
IOException
-
close
Description copied from class:AbstractDBParser
Override this for any special handling of closing the connection.- Overrides:
close
in classAbstractDBParser
- Throws:
SQLException
IOException
-
getJDBCClassName
Description copied from class:AbstractDBParser
JDBC class name, e.g. org.sqlite.JDBC- Specified by:
getJDBCClassName
in classAbstractDBParser
- Returns:
- jdbc class name
-
getTableNames
protected List<String> getTableNames(Connection connection, Metadata metadata, ParseContext context) throws SQLException Description copied from class:AbstractDBParser
Returns the names of the tables to process- Specified by:
getTableNames
in classAbstractDBParser
- Parameters:
connection
- Connection to use to make the sql call(s) to get the names of the tablesmetadata
- Metadata to use (potentially) in decision about which tables to extractcontext
- ParseContext to use (potentially) in decision about which tables to extract- Returns:
- Throws:
SQLException
-
getTableReader
public JDBCTableReader getTableReader(Connection connection, String tableName, ParseContext context) Description copied from class:AbstractDBParser
Given a connection and a table name, return the JDBCTableReader for this db.- Specified by:
getTableReader
in classAbstractDBParser
- Returns:
- a reader
-
getTableReader
protected JDBCTableReader getTableReader(Connection connection, String tableName, EmbeddedDocumentUtil embeddedDocumentUtil) Description copied from class:AbstractDBParser
Given a connection and a table name, return the JDBCTableReader for this db.- Specified by:
getTableReader
in classAbstractDBParser
embeddedDocumentUtil
- embedded doc util- Returns:
-
extractMetadata
Description copied from class:AbstractDBParser
This is called before parsing the tables to extract metadata from the db, if any. Override this for db specific metadata. This implementation is a no-op- Overrides:
extractMetadata
in classAbstractDBParser
-