bugfix
This commit is contained in:
parent
30530c0648
commit
69544b4552
1 changed files with 7 additions and 4 deletions
|
|
@ -24,14 +24,17 @@ public class DeviceDataSqlResult implements SQLResultHandler<HalDeviceData> {
|
||||||
@Override
|
@Override
|
||||||
public HalDeviceData handleQueryResult(Statement stmt, ResultSet result) throws SQLException {
|
public HalDeviceData handleQueryResult(Statement stmt, ResultSet result) throws SQLException {
|
||||||
try {
|
try {
|
||||||
HalDeviceData dataObj = clazz.newInstance();
|
if (result.next()) {
|
||||||
dataObj.setData(result.getDouble("data"));
|
HalDeviceData dataObj = clazz.newInstance();
|
||||||
dataObj.setTimestamp(result.getLong("timestamp"));
|
dataObj.setData(result.getDouble("data"));
|
||||||
return dataObj;
|
dataObj.setTimestamp(result.getLong("timestamp"));
|
||||||
|
return dataObj;
|
||||||
|
}
|
||||||
} catch (SQLException e){
|
} catch (SQLException e){
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
throw new SQLException(e);
|
throw new SQLException(e);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue