|
|
@ -51,6 +51,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
MobileDevice mobileDevice = null;
|
|
|
|
MobileDevice mobileDevice = null;
|
|
|
|
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
conn = MobileDeviceManagementDAOFactory.getConnection();
|
|
|
|
conn = MobileDeviceManagementDAOFactory.getConnection();
|
|
|
|
String selectDBQuery =
|
|
|
|
String selectDBQuery =
|
|
|
@ -59,7 +60,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
" FROM AD_DEVICE WHERE ANDROID_DEVICE_ID = ?";
|
|
|
|
" FROM AD_DEVICE WHERE ANDROID_DEVICE_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt.setString(1, mblDeviceId);
|
|
|
|
stmt.setString(1, mblDeviceId);
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
resultSet = stmt.executeQuery();
|
|
|
|
|
|
|
|
|
|
|
|
if (resultSet.next()) {
|
|
|
|
if (resultSet.next()) {
|
|
|
|
mobileDevice = new MobileDevice();
|
|
|
|
mobileDevice = new MobileDevice();
|
|
|
@ -94,7 +95,8 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null);
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(stmt, resultSet);
|
|
|
|
|
|
|
|
MobileDeviceManagementDAOFactory.closeConnection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return mobileDevice;
|
|
|
|
return mobileDevice;
|
|
|
@ -150,7 +152,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null);
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -205,7 +207,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null);
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -235,7 +237,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null);
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -243,10 +245,13 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<MobileDevice> getAllMobileDevices()
|
|
|
|
public List<MobileDevice> getAllMobileDevices()
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
|
|
|
|
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
MobileDevice mobileDevice;
|
|
|
|
MobileDevice mobileDevice;
|
|
|
|
List<MobileDevice> mobileDevices = new ArrayList<MobileDevice>();
|
|
|
|
List<MobileDevice> mobileDevices = new ArrayList<MobileDevice>();
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
conn = MobileDeviceManagementDAOFactory.getConnection();
|
|
|
|
conn = MobileDeviceManagementDAOFactory.getConnection();
|
|
|
|
String selectDBQuery =
|
|
|
|
String selectDBQuery =
|
|
|
@ -254,7 +259,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
"VENDOR, MAC_ADDRESS, DEVICE_NAME, LATITUDE, LONGITUDE, IMEI, IMSI, OS_VERSION " +
|
|
|
|
"VENDOR, MAC_ADDRESS, DEVICE_NAME, LATITUDE, LONGITUDE, IMEI, IMSI, OS_VERSION " +
|
|
|
|
"FROM AD_DEVICE";
|
|
|
|
"FROM AD_DEVICE";
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
stmt = conn.prepareStatement(selectDBQuery);
|
|
|
|
ResultSet resultSet = stmt.executeQuery();
|
|
|
|
resultSet = stmt.executeQuery();
|
|
|
|
while (resultSet.next()) {
|
|
|
|
while (resultSet.next()) {
|
|
|
|
mobileDevice = new MobileDevice();
|
|
|
|
mobileDevice = new MobileDevice();
|
|
|
|
mobileDevice.setMobileDeviceId(resultSet.getString(AndroidPluginConstants.
|
|
|
|
mobileDevice.setMobileDeviceId(resultSet.getString(AndroidPluginConstants.
|
|
|
@ -288,7 +293,8 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
throw new MobileDeviceManagementDAOException(msg, e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null);
|
|
|
|
MobileDeviceManagementDAOUtil.cleanupResources(stmt, resultSet);
|
|
|
|
|
|
|
|
MobileDeviceManagementDAOFactory.closeConnection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|