From 0621579d2581303e2b459291b8517b2b94cf4dfa Mon Sep 17 00:00:00 2001 From: Thomson Ignesious Date: Mon, 5 Jun 2017 18:25:15 +0530 Subject: [PATCH] case sensitiv stmt = conn.prepareStatement(sql, new String[]{"ID"}) this line makes case sensitive issues, an exception saying 'ID' does not exist while using the postgreSQL. --- .../org/wso2/carbon/device/mgt/core/dao/impl/GroupDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/GroupDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/GroupDAOImpl.java index 7d9947a421..ddc120a5c1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/GroupDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/GroupDAOImpl.java @@ -47,7 +47,7 @@ public class GroupDAOImpl implements GroupDAO { try { Connection conn = GroupManagementDAOFactory.getConnection(); String sql = "INSERT INTO DM_GROUP(DESCRIPTION, GROUP_NAME, OWNER, TENANT_ID) VALUES (?, ?, ?, ?)"; - stmt = conn.prepareStatement(sql, new String[]{"ID"}); + stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); stmt.setString(1, deviceGroup.getDescription()); stmt.setString(2, deviceGroup.getName()); stmt.setString(3, deviceGroup.getOwner());