1
0

initial commit DataBase branche

This commit is contained in:
Rémi Heredero 2023-05-15 09:43:50 +02:00
parent ff5bfc409b
commit cdc5dddb80
3 changed files with 24 additions and 0 deletions

4
src/config.properties Normal file
View File

@ -0,0 +1,4 @@
URL = https://influx.sdi.hevs.ch
ORG = SIn15
BUCKET = SIn15
TOKEN = ${SECRET_TOKEN}

View File

@ -4,7 +4,9 @@ package ch.hevs.isi.db;
import ch.hevs.isi.core.DataPoint;
import ch.hevs.isi.core.DataPointListener;
public class DatabaseConnector implements DataPointListener {
String token = "bW6-s_EkTkZ-rT-Mj0kt1uZQYOPKio5FdEK-OtwWJlxDwYQ5OkH599t1jUz4VV47SrkKonLDHB0jRJ3Eu6OUTA==";
private static DatabaseConnector mySelf = null;
private DatabaseConnector (){

View File

@ -0,0 +1,18 @@
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
public class Database {
public static void main(String[] args) {
Properties properties = new Properties();
try (InputStream input = new FileInputStream("src/config.properties")) {
properties.load(input);
} catch (Exception e) {
e.printStackTrace();
}
String token = properties.getProperty("TOKEN");
System.out.println(token);
}
}