Merge pull request #855 from hasuniea/master

fixing updateEnrollment status issue
revert-70aa11f8
Kamidu Sachith Punchihewa 8 years ago committed by GitHub
commit 6bab255b88

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

Loading…
Cancel
Save