diff --git a/src/se/koc/hal/deamon/DataAggregatorDaemon.java b/src/se/koc/hal/deamon/DataAggregatorDaemon.java index 6cb32c55..872af6c2 100755 --- a/src/se/koc/hal/deamon/DataAggregatorDaemon.java +++ b/src/se/koc/hal/deamon/DataAggregatorDaemon.java @@ -50,7 +50,7 @@ public class DataAggregatorDaemon extends TimerTask implements HalDaemon { try { stmt = db.getPreparedStatement("SELECT MAX(timestamp_end) FROM sensor_data_aggr WHERE sensor_id == ?"); stmt.setLong(1, sensorId); - Long maxDBTimestamp = DBConnection.exec(stmt, new SimpleSQLHandler()); + Long maxDBTimestamp = DBConnection.exec(stmt, new SimpleSQLResult()); if(maxDBTimestamp == null) maxDBTimestamp = 0l; // 5 minute aggregation @@ -69,7 +69,7 @@ public class DataAggregatorDaemon extends TimerTask implements HalDaemon { +" WHERE sensor_id == ? AND timestamp_end-timestamp_start == ?"); stmt.setLong(1, sensorId); stmt.setLong(2, HOUR_IN_MS-1); - maxDBTimestamp = DBConnection.exec(stmt, new SimpleSQLHandler()); + maxDBTimestamp = DBConnection.exec(stmt, new SimpleSQLResult()); if(maxDBTimestamp == null) maxDBTimestamp = 0l; long hourPeriodTimestamp = getTimestampMinutePeriodStart(60, System.currentTimeMillis()-HOUR_AGGREGATION_OFFSET); @@ -87,7 +87,7 @@ public class DataAggregatorDaemon extends TimerTask implements HalDaemon { stmt = db.getPreparedStatement("SELECT MAX(timestamp_end) FROM sensor_data_aggr WHERE sensor_id == ? AND timestamp_end-timestamp_start == ?"); stmt.setLong(1, sensorId); stmt.setLong(2, DAY_IN_MS-1); - maxDBTimestamp = DBConnection.exec(stmt, new SimpleSQLHandler()); + maxDBTimestamp = DBConnection.exec(stmt, new SimpleSQLResult()); if(maxDBTimestamp == null) maxDBTimestamp = 0l; long dayPeriodTimestamp = getTimestampHourPeriodStart(24, System.currentTimeMillis()-DAY_AGGREGATION_OFFSET); diff --git a/src/se/koc/hal/page/PCOverviewHttpPage.java b/src/se/koc/hal/page/PCOverviewHttpPage.java index 334e877d..79f8e5bb 100755 --- a/src/se/koc/hal/page/PCOverviewHttpPage.java +++ b/src/se/koc/hal/page/PCOverviewHttpPage.java @@ -116,7 +116,7 @@ public class PCOverviewHttpPage implements HttpPage { //add null data point to list if one or more periods of data is missing before this if(previousTimestampEnd != -1 && timestampStart-previousTimestampEnd > periodLength){ - list.add(new PowerData(previousTimestampEnd+1, "undefined", username)); + list.add(new PowerData(previousTimestampEnd+1, "null", username)); } //add this data point to list diff --git a/src/se/koc/hal/struct/Sensor.java b/src/se/koc/hal/struct/Sensor.java index 9537a4e5..83279e7b 100755 --- a/src/se/koc/hal/struct/Sensor.java +++ b/src/se/koc/hal/struct/Sensor.java @@ -39,7 +39,7 @@ public class Sensor extends DBBean{ public static long getHighestSequenceId(long sensorId) throws SQLException{ PreparedStatement stmt = HalContext.getDB().getPreparedStatement("SELECT MAX(sequence_id) FROM sensor_data_aggr WHERE sensor_id == ?"); stmt.setLong(1, sensorId); - Integer id = DBConnection.exec(stmt, new SimpleSQLHandler()); + Integer id = DBConnection.exec(stmt, new SimpleSQLResult()); return (id != null ? id+1 : 1); }