revert-70aa11f8
Harshan Liyanage 7 years ago
parent 88303f7f94
commit 21692f1ab6

@ -170,6 +170,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
throws OperationManagementDAOException { throws OperationManagementDAOException {
PreparedStatement stmt = null; PreparedStatement stmt = null;
ResultSet rs = null; ResultSet rs = null;
boolean result = false;
try { try {
Connection connection = OperationManagementDAOFactory.getConnection(); Connection connection = OperationManagementDAOFactory.getConnection();
String query = "SELECT EOM.ID FROM DM_ENROLMENT_OP_MAPPING EOM INNER JOIN DM_OPERATION DM " String query = "SELECT EOM.ID FROM DM_ENROLMENT_OP_MAPPING EOM INNER JOIN DM_OPERATION DM "
@ -181,13 +182,16 @@ public class GenericOperationDAOImpl implements OperationDAO {
stmt.setString(3, Operation.Status.PENDING.toString()); stmt.setString(3, Operation.Status.PENDING.toString());
// This will return only one result always. // This will return only one result always.
rs = stmt.executeQuery(); rs = stmt.executeQuery();
return true; if (rs.next()) {
result = true;
}
} catch (SQLException e) { } catch (SQLException e) {
throw new OperationManagementDAOException( throw new OperationManagementDAOException(
"Error occurred while update device mapping operation status " + "metadata", e); "Error occurred while update device mapping operation status " + "metadata", e);
} finally { } finally {
OperationManagementDAOUtil.cleanupResources(stmt, rs); OperationManagementDAOUtil.cleanupResources(stmt, rs);
} }
return result;
} }
@Override @Override

Loading…
Cancel
Save