+ private static void updateConfigData(Connection conn, String configurationdataid, StringBuilder policyDataString) throws Exception {
+
+ PreparedStatement pstmt = null;
+ ResultSet configResult = null;
+ try {
+ String configEntityQuery = "Select * from ConfigurationDataEntity where configurationDataId = ?";
+ pstmt = null;
+ pstmt = conn.prepareStatement(configEntityQuery);
+ pstmt.setString(1, configurationdataid);
+ configResult = pstmt.executeQuery();
+ while(configResult.next()){
+ String configBody = configResult.getString("configbody");
+ String configType = configResult.getString("configtype");
+ if(configBody!=null){
+ configBody = configBody.replace("null", "\"\"");
+ configBody= configBody.replace("\"", "\\\"");
+ policyDataString.append("\"jsonBodyData\":\""+configBody+"\",\"configType\":\""+configType+"\",");
+ }
+ }
+ } catch(Exception e) {
+ LOGGER.error("Exception Occured while updating configData"+e);
+ throw(e);
+ } finally {
+ if(configResult != null){
+ try {
+ configResult.close();
+ } catch (Exception e) {
+ LOGGER.error("Exception Occured while closing the ResultSet"+e);
+ }
+ }
+ if(pstmt != null){
+ try {
+ pstmt.close();
+ } catch (Exception e) {
+ LOGGER.error("Exception Occured while closing the PreparedStatement"+e);
+ }
+ }
+ }
+ }
+
+ private static void updateActionData(Connection conn, String actionbodyid, StringBuilder policyDataString) throws Exception {
+
+ PreparedStatement pstmt = null;
+ ResultSet actionResult = null;
+ try {
+ String actionEntityQuery = "Select * from ActionBodyEntity where actionBodyId = ?";
+ pstmt = conn.prepareStatement(actionEntityQuery);
+ pstmt.setString(1, actionbodyid);
+ actionResult = pstmt.executeQuery();
+ while(actionResult.next()){
+ String actionBody = actionResult.getString("actionbody");
+ actionBody = actionBody.replace("null", "\"\"");
+ actionBody = actionBody.replace("\"", "\\\"");
+ policyDataString.append("\"jsonBodyData\":\""+actionBody+"\",");
+ }
+ } catch(Exception e) {
+ LOGGER.error("Exception Occured while updating actionData"+e);
+ throw(e);
+ } finally {
+ if(actionResult != null){
+ try {
+ actionResult.close();
+ } catch (Exception e) {
+ LOGGER.error("Exception Occured while closing the ResultSet"+e);
+ }
+ }
+ if(pstmt != null){
+ try {
+ pstmt.close();
+ } catch (Exception e) {
+ LOGGER.error("Exception Occured while closing the PreparedStatement"+e);
+ }
+ }
+ }
+ }