Add DBHandler
parent
ac1c027a17
commit
d7451301be
@ -1 +1 @@
|
||||
./config.json
|
||||
config.json
|
@ -1,5 +1,12 @@
|
||||
{
|
||||
"storePath": "./data/",
|
||||
"apiURL": "https://data.sensor.community/airrohr/v1/sensor/35943/",
|
||||
"interval": 150
|
||||
"interval": 150,
|
||||
"sqlConnection": {
|
||||
"db": "",
|
||||
"pw": "",
|
||||
"user": "",
|
||||
"port": 3306,
|
||||
"server": "localhost"
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package sh.adb.sensorCommunityAPI;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
|
||||
public class dbHandler {
|
||||
String pw;
|
||||
String db;
|
||||
String user;
|
||||
int port;
|
||||
String server;
|
||||
|
||||
dbHandler(JSONObject config){
|
||||
this.pw = (String) config.get("pw");
|
||||
this.db = (String) config.get("db");
|
||||
this.user = (String) config.get("user");
|
||||
this.port = (Integer) config.get("port");
|
||||
this.server = (String) config.get("server");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue