diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index 7e040700637..09626d9c3dd 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -1352,12 +1352,12 @@ public class PolicyDAOImpl implements PolicyDAO { int policyCount = 0; try { conn = this.getConnection(); - String query = "SELECT COUNT(DM_POLICY.ID) FROM DM_POLICY"; + String query = "SELECT COUNT(ID) AS POLICY_COUNT FROM DM_POLICY"; stmt = conn.prepareStatement(query); resultSet = stmt.executeQuery(); while (resultSet.next()) { - policyCount = resultSet.getInt(0); + policyCount = resultSet.getInt("POLICY_COUNT"); } return policyCount;