mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Refactored Enrollment DAO class
This commit is contained in:
parent
271c4f76cb
commit
4379232c25
@ -71,6 +71,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
int status = -1;
|
||||
int rows;
|
||||
try {
|
||||
conn = this.getConnection();
|
||||
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, " +
|
||||
@ -85,12 +86,12 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
|
||||
stmt.setString(6, enrolmentInfo.getOwner());
|
||||
stmt.setInt(7, tenantId);
|
||||
stmt.setInt(8, enrolmentInfo.getId());
|
||||
stmt.executeUpdate();
|
||||
rows = stmt.executeUpdate();
|
||||
|
||||
rs = stmt.getGeneratedKeys();
|
||||
if (rs.next()) {
|
||||
if (rows > 0) {
|
||||
status = 1;
|
||||
}
|
||||
|
||||
return status;
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while updating enrolment configuration", e);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user