Functions Importer DatabaseImporter - SmartEnviroSystem/SmartDataPorter GitHub Wiki
The DatabaseImporter aims to import from other non SmartData Databases. It is able to import data from any database where a JDBC driver is available.
Configuration
The configuration contains mainly access data for the database.
| Parameter | Description | Default | Optional |
|---|---|---|---|
| db.driver | JDBC driver name (e.g. org.mariadb.jdbc.Driver) | - | no |
| db.dbms | Name of the DBMS (e.g. mariadb) | - | no |
| db.host | Databaseserver host address | - | no |
| db.port | Databaseserver port | - | no |
| db.user | Database user name | - | no |
| db.pwd | Database user password | - | no |
| db.name | Database name | - | no |
| db.table | Database table | - | yes |
| db.sql_query | SQL query for imports with conditions | - | yes |
| db.query_blocksize | Number of datasets to query at once | 1000 | yes |
| db.query_maxblocks | Number of blocks to query | inf | yes |
Example configuration:
{
// Import target
"server":"https://scl.hsbi.de/",
"usethreading": true,
"smartdata":"SmartDataHELIOS",
"storage":"smartmonitoring",
"collection":"throsenheim_ceilometer",
// Importer configuration
"importer":"DatabaseImporter",
"db.driver": "org.mariadb.jdbc.Driver",
"db.dbms": "mariadb",
"db.host":"mariadb.mydb.de",
"db.port":"3306",
"db.user":"user-name",
"db.pwd":"user-pwd",
"db.name":"database_name",
"db.table":"table_name",
"db.sql_query":"",
"db.query_blocksize": 5000,
"db.query_maxblocks": 10
}