From 7212e969d805f37008a0ebb23cdd67c7fd2db5eb Mon Sep 17 00:00:00 2001 From: kamidu Date: Tue, 25 Oct 2016 17:22:18 +0530 Subject: [PATCH] Fix for SQL query issue in mysql --- .../core/operation/mgt/dao/impl/CommandOperationDAOImpl.java | 2 +- .../core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java | 4 ++-- .../core/operation/mgt/dao/impl/GenericOperationDAOImpl.java | 2 +- .../core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java | 2 +- .../core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java index d21872b103..fcf57ab022 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java @@ -76,7 +76,7 @@ public class CommandOperationDAOImpl extends GenericOperationDAOImpl { try { super.deleteOperation(id); Connection connection = OperationManagementDAOFactory.getConnection(); - stmt = connection.prepareStatement("DELETE DM_COMMAND_OPERATION WHERE OPERATION_ID = ?"); + stmt = connection.prepareStatement("DELETE FROM DM_COMMAND_OPERATION WHERE OPERATION_ID = ?"); stmt.setInt(1, id); stmt.executeUpdate(); } catch (SQLException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java index e6994977ad..c847c7652c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java @@ -64,7 +64,7 @@ public class ConfigOperationDAOImpl extends GenericOperationDAOImpl { try { super.deleteOperation(id); Connection connection = OperationManagementDAOFactory.getConnection(); - stmt = connection.prepareStatement("DELETE DM_CONFIG_OPERATION WHERE OPERATION_ID = ?") ; + stmt = connection.prepareStatement("DELETE FROM DM_CONFIG_OPERATION WHERE OPERATION_ID = ?") ; stmt.setInt(1, id); stmt.executeUpdate(); } catch (SQLException e) { @@ -82,7 +82,7 @@ public class ConfigOperationDAOImpl extends GenericOperationDAOImpl { try { super.updateOperation(operation); Connection connection = OperationManagementDAOFactory.getConnection(); - stmt = connection.prepareStatement("UPDATE DM_CONFIG_OPERATION SET OPERATION_CONFIG = ? " + + stmt = connection.prepareStatement("UPDATE FROM DM_CONFIG_OPERATION SET OPERATION_CONFIG = ? " + "WHERE OPERATION_ID = ?"); bao = new ByteArrayOutputStream(); oos = new ObjectOutputStream(bao); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 760a2f6e75..fcfecce9d9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -622,7 +622,7 @@ public class GenericOperationDAOImpl implements OperationDAO { PreparedStatement stmt = null; try { Connection connection = OperationManagementDAOFactory.getConnection(); - stmt = connection.prepareStatement("DELETE DM_OPERATION WHERE ID = ?"); + stmt = connection.prepareStatement("DELETE FROM DM_OPERATION WHERE ID = ?"); stmt.setInt(1, id); stmt.executeUpdate(); } catch (SQLException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java index 957f206f3a..4c0243ac80 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java @@ -128,7 +128,7 @@ public class PolicyOperationDAOImpl extends GenericOperationDAOImpl { try { super.deleteOperation(operationId); Connection connection = OperationManagementDAOFactory.getConnection(); - stmt = connection.prepareStatement("DELETE DM_POLICY_OPERATION WHERE OPERATION_ID=?"); + stmt = connection.prepareStatement("DELETE FROM DM_POLICY_OPERATION WHERE OPERATION_ID=?"); stmt.setInt(1, operationId); stmt.executeUpdate(); } catch (SQLException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index 4cc496c853..931cc079f4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -129,7 +129,7 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { try { super.deleteOperation(id); Connection connection = OperationManagementDAOFactory.getConnection(); - stmt = connection.prepareStatement("DELETE DM_PROFILE_OPERATION WHERE OPERATION_ID=?"); + stmt = connection.prepareStatement("DELETE FROM DM_PROFILE_OPERATION WHERE OPERATION_ID=?"); stmt.setInt(1, id); stmt.executeUpdate(); } catch (SQLException e) {