|
|
@ -28,8 +28,9 @@ public class DBHandler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public void storeInDB(String country, int sensorID, String timeStamp, String value_type_p1, int id_p1, float value_p1, String value_type_p2, int id_p2, float value_p2, String allJSON) {
|
|
|
|
public void storeInDB(String country, int sensorID, String timeStamp, String value_type_p1, int id_p1, float value_p1, String value_type_p2, int id_p2, float value_p2, String allJSON) {
|
|
|
|
try (Statement stmt = this.connection.createStatement()) {
|
|
|
|
try (Statement stmt = this.connection.createStatement()) {
|
|
|
|
//stmt.executeUpdate("INSERT INTO apidata (id, country, sensorID, Timestamp, value_type_p1, id_p1, value_p1, value_type_p2, id_p2, value_p2, allJSON ) VALUES (0, " + country + ", " + sensorID + ", " + timeStamp + ", " + value_type_p1 + ", " + id_p1 + ", " + value_p1 + ", " + value_type_p2 + ", " + id_p2 + ", " + value_p2 + ", " + allJSON + ")");
|
|
|
|
stmt.executeUpdate("" +
|
|
|
|
stmt.executeUpdate("INSERT INTO apidata (id, country, sensorID, Timestamp, value_type_p1, id_p1, value_p1, value_type_p2, id_p2, value_p2, allJSON ) VALUES ( NULL , '" + country + "', " + sensorID + " , '" + timeStamp +"', '" + value_type_p1 + "', " + id_p1 + ", " + value_p1 + ", '" + value_type_p2 + "', " + id_p2 + " , " + value_p2 + " , '" + allJSON + "' )");
|
|
|
|
"INSERT INTO apidata (id, country, sensorID, Timestamp, value_type_p1, id_p1, value_p1, value_type_p2, id_p2, value_p2, allJSON )" +
|
|
|
|
|
|
|
|
"VALUES ( NULL , '" + country + "', " + sensorID + " , '" + timeStamp +"', '" + value_type_p1 + "', " + id_p1 + ", " + value_p1 + ", '" + value_type_p2 + "', " + id_p2 + " , " + value_p2 + " , '" + allJSON + "' )");
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|