Infinit.e supports harvesting data from traditional RDBMS (Relational Database Management Systems) using JDBC (Java Database Connectivity) drivers. The Sample Database Harvester Specification below demonstrates how to connect to and extract data from a database using the harvester:
Sample Database Harvester Specification
source : { ... "extractType" : "Database", "authentication" : { "username" : "username", "password" : "password"}, "database" : { "databaseType" : "mysql", "hostname" : "my.databaseserver.com", "port" : "3306" "databaseName" : "database", "query" : "SELECT * FROM IncidentReport", "deltaQuery" : "SELECT * FROM IncidentReport WHERE REPORTDATETIME >= (SELECT ADDDATE(CURDATE(),-7))", "deleteQuery" : "", "primaryKey" : "NID", "title" : "CCN", "snippet" : "OFFENSE", "publishedDate" : "REPORTDATETIME" }, "useExtractor" : "none", ... }
* extractType
The extractType field is used to tell the harvester the type of source to extract from, i.e.: Database. Other valid values include: File, Feed, etc.
- authentication
The Authentication object of the Source document is a subset of the full Authentication object in that it only uses the 'username' and 'password' fields. The Database Harvester uses the username and password from the Authentication object as database credentials (if needed).- username
- password
Note: The password field in the Authentication object is currently clear text. If the string value placed in password is clear text it is not encrypted by Infinit.e. Encryption of the password field is planned for a future release.
- database
The Database object- databaseType
The type of RDBMS to connect to. Valid values currently include: mysql, db2, oracle, mssqlserver, sybase. - hostname
The 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.
- databaseType
-
- databaseName
The name of the database to connect to. - query
The 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. - deltaQuery
The deltaQuery field is used to specify the SQL that extracts data from the source RDBS based on some sort of delta value like created or modified data for a record. - deleteQuery
- databaseName
Note: The deleteQuery functionality of the Database Harvester is not implemented in the Beta version of Infinit.e.
-
- primaryKey
- title
- snippet
- publishedData
- useExtractor