Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Database extractor supports harvesting data from traditional RDBMS (Relational Database Management Systems) using JDBC (Java Database Connectivity) drivers.

...

FieldDescription
urlurl for the database.
usernameUsername for the database credentials.
password

From v0.3, password can be either plaintext or encrypted. In earlier versions, password must be encrypted.

download the jasypt command line utility to encrypt (link) - use "infinit.e" as the "password" (actually the salt).

databaseType

The type of RDBMS to connect to. Valid values currently include: mysql, db2, oracle, oracle:thin:sid, mssqlserver, sybase.  (Additional types can be added via configuration)

NOTE: the corresponding JDBC JARs must be installed - contact your administrator if not.

hostanmeThe hostname of the database server to connect to, i.e. "my.databaseserver.com" in the example above.
 port The port that the database accepts incoming connections on.
databaseNameThe name of the database to connect to.
queryThe query field is used to specify the SQL used to perform a full extraction of data for the source. This is generally used the first time the harvester extracts data from a source with incremental extractions being specified using the deltaQuery below.
deltaQueryThe deltaQuery field is used to specify the SQL that extracts data from the source RDBS based on one or more delta values, i.e. created or modified date for a record.
deleteQueryNote: The deleteQuery functionality of the Database Harvester is not implemented in the Beta version of Infinit.e.
primaryKeyPrimary key field in data set, used to help identify whether a record is new or previously harvested.
primaryKeyValuePrimary key value, only used when placing in the feed record.
titleRecord field used to populate the document's title field.
snippetRecord field used to populate the document's description field.
publishedDateRecord field used to populate the document's published date field.

...

Connecting to the Database

The database extractor uses a combination of the databaseName, databaseType, hostname, port, username, and password fields to connect to the database via jdbc.

To connect to the database url, the following url format can be used:

...

Info
if no 'primaryKey' is specified then a random string is used

Example:

...

If no value is specified for primaryKeyValue the following format is used

  • database.url + record.get(primaryKey)

Example:

...

Examples

Obtaining Data from the Database

...