Merge pull request #855 from hasuniea/master

fixing updateEnrollment status issue
merge-requests/1/head
Kamidu Sachith Punchihewa 7 years ago committed by GitHub
commit 6bab255b88

@ -71,7 +71,6 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int status = -1;
try {
conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, DATE_OF_LAST_UPDATE = ? WHERE DEVICE_ID = ?" +
@ -84,7 +83,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
stmt.setString(5, enrolmentInfo.getOwner());
stmt.setInt(6, tenantId);
stmt.setInt(7, enrolmentInfo.getId());
stmt.executeUpdate();
int status = stmt.executeUpdate();
return status;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while updating enrolment configuration", e);
@ -98,7 +97,6 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int status = -1;
try {
conn = this.getConnection();
String sql = "UPDATE DM_ENROLMENT SET OWNERSHIP = ?, STATUS = ?, DATE_OF_LAST_UPDATE = ? WHERE ID = ?";
@ -107,7 +105,7 @@ public class EnrollmentDAOImpl implements EnrollmentDAO {
stmt.setString(2, enrolmentInfo.getStatus().toString());
stmt.setTimestamp(3, new Timestamp(new Date().getTime()));
stmt.setInt(4, enrolmentInfo.getId());
stmt.executeUpdate();
int status = stmt.executeUpdate();
return status;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while updating enrolment configuration", e);

Loading…
Cancel
Save