|
|
@ -50,8 +50,8 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
|
|
|
|
stmt = conn.prepareStatement("INSERT INTO DM_DEVICE_DETAIL (DEVICE_ID, DEVICE_MODEL, " +
|
|
|
|
stmt = conn.prepareStatement("INSERT INTO DM_DEVICE_DETAIL (DEVICE_ID, DEVICE_MODEL, " +
|
|
|
|
"VENDOR, OS_VERSION, BATTERY_LEVEL, INTERNAL_TOTAL_MEMORY, INTERNAL_AVAILABLE_MEMORY, " +
|
|
|
|
"VENDOR, OS_VERSION, BATTERY_LEVEL, INTERNAL_TOTAL_MEMORY, INTERNAL_AVAILABLE_MEMORY, " +
|
|
|
|
"EXTERNAL_TOTAL_MEMORY, EXTERNAL_AVAILABLE_MEMORY, CONNECTION_TYPE, " +
|
|
|
|
"EXTERNAL_TOTAL_MEMORY, EXTERNAL_AVAILABLE_MEMORY, CONNECTION_TYPE, " +
|
|
|
|
"SSID, CPU_USAGE, TOTAL_RAM_MEMORY, AVAILABLE_RAM_MEMORY, PLUGGED_IN) " +
|
|
|
|
"SSID, CPU_USAGE, TOTAL_RAM_MEMORY, AVAILABLE_RAM_MEMORY, PLUGGED_IN, UPDATE_TIMESTAMP) " +
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
|
|
|
|
|
|
|
|
|
|
stmt.setInt(1, deviceInfo.getDeviceId());
|
|
|
|
stmt.setInt(1, deviceInfo.getDeviceId());
|
|
|
|
stmt.setString(2, deviceInfo.getDeviceModel());
|
|
|
|
stmt.setString(2, deviceInfo.getDeviceModel());
|
|
|
@ -68,6 +68,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
|
|
|
|
stmt.setDouble(13, deviceInfo.getTotalRAMMemory());
|
|
|
|
stmt.setDouble(13, deviceInfo.getTotalRAMMemory());
|
|
|
|
stmt.setDouble(14, deviceInfo.getAvailableRAMMemory());
|
|
|
|
stmt.setDouble(14, deviceInfo.getAvailableRAMMemory());
|
|
|
|
stmt.setBoolean(15, deviceInfo.isPluggedIn());
|
|
|
|
stmt.setBoolean(15, deviceInfo.isPluggedIn());
|
|
|
|
|
|
|
|
stmt.setLong(16, System.currentTimeMillis());
|
|
|
|
|
|
|
|
|
|
|
|
stmt.execute();
|
|
|
|
stmt.execute();
|
|
|
|
|
|
|
|
|
|
|
@ -144,6 +145,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
|
|
|
|
deviceInfo.setTotalRAMMemory(rs.getDouble("TOTAL_RAM_MEMORY"));
|
|
|
|
deviceInfo.setTotalRAMMemory(rs.getDouble("TOTAL_RAM_MEMORY"));
|
|
|
|
deviceInfo.setAvailableRAMMemory(rs.getDouble("AVAILABLE_RAM_MEMORY"));
|
|
|
|
deviceInfo.setAvailableRAMMemory(rs.getDouble("AVAILABLE_RAM_MEMORY"));
|
|
|
|
deviceInfo.setPluggedIn(rs.getBoolean("PLUGGED_IN"));
|
|
|
|
deviceInfo.setPluggedIn(rs.getBoolean("PLUGGED_IN"));
|
|
|
|
|
|
|
|
deviceInfo.setUpdatedTime(new java.util.Date(rs.getLong("UPDATE_TIMESTAMP")));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deviceInfo.setDeviceId(deviceId);
|
|
|
|
deviceInfo.setDeviceId(deviceId);
|
|
|
@ -226,7 +228,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
conn = this.getConnection();
|
|
|
|
conn = this.getConnection();
|
|
|
|
stmt = conn.prepareStatement("INSERT INTO DM_DEVICE_LOCATION (DEVICE_ID, LATITUDE, LONGITUDE, STREET1, " +
|
|
|
|
stmt = conn.prepareStatement("INSERT INTO DM_DEVICE_LOCATION (DEVICE_ID, LATITUDE, LONGITUDE, STREET1, " +
|
|
|
|
"STREET2, CITY, ZIP, STATE, COUNTRY) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
|
|
"STREET2, CITY, ZIP, STATE, COUNTRY, UPDATE_TIMESTAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
|
|
stmt.setInt(1, deviceLocation.getDeviceId());
|
|
|
|
stmt.setInt(1, deviceLocation.getDeviceId());
|
|
|
|
stmt.setDouble(2, deviceLocation.getLatitude());
|
|
|
|
stmt.setDouble(2, deviceLocation.getLatitude());
|
|
|
|
stmt.setDouble(3, deviceLocation.getLongitude());
|
|
|
|
stmt.setDouble(3, deviceLocation.getLongitude());
|
|
|
@ -236,6 +238,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
|
|
|
|
stmt.setString(7, deviceLocation.getZip());
|
|
|
|
stmt.setString(7, deviceLocation.getZip());
|
|
|
|
stmt.setString(8, deviceLocation.getState());
|
|
|
|
stmt.setString(8, deviceLocation.getState());
|
|
|
|
stmt.setString(9, deviceLocation.getCountry());
|
|
|
|
stmt.setString(9, deviceLocation.getCountry());
|
|
|
|
|
|
|
|
stmt.setLong(10, System.currentTimeMillis());
|
|
|
|
stmt.execute();
|
|
|
|
stmt.execute();
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new DeviceDetailsMgtDAOException("Error occurred while adding the device location to database.", e);
|
|
|
|
throw new DeviceDetailsMgtDAOException("Error occurred while adding the device location to database.", e);
|
|
|
@ -268,6 +271,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
|
|
|
|
location.setZip(rs.getString("ZIP"));
|
|
|
|
location.setZip(rs.getString("ZIP"));
|
|
|
|
location.setState(rs.getString("STATE"));
|
|
|
|
location.setState(rs.getString("STATE"));
|
|
|
|
location.setCountry(rs.getString("COUNTRY"));
|
|
|
|
location.setCountry(rs.getString("COUNTRY"));
|
|
|
|
|
|
|
|
location.setUpdatedTime(new java.util.Date(rs.getLong("UPDATE_TIMESTAMP")));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
location.setDeviceId(deviceId);
|
|
|
|
location.setDeviceId(deviceId);
|
|
|
|
|
|
|
|
|
|
|
|