public static boolean Presellitemstatusinsert(
      String rstxdate,
      String rsloccode,
      String rsregno,
      String rstxno,
      String rsseqno,
      String rseventid,
      String rssku,
      String rsorderqty,
      String rsdpno,
      String rsstatus,
      String rspickuploc,
      String rslastupdusr,
      Timestamp rslastupddt,
      String rslastupdver,
      String rsallocateqty,
      String rspono,
      String rscururet,
      String rsrowguid,
      String frdatabase)
      throws SQLException {

    boolean result = true;
    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;
    String insertTableSQL;

    try {

      if (Objects.equals(frdatabase, "Oracle")) {
        // dbConnection = Merge.getDBConnection();

        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();

        insertTableSQL =
            "INSERT INTO PRESELL_ITEM_STATUS"
                + "(TX_DATE,LOC_CODE,REG_NO,TX_NO,SEQ_NO,EVENT_ID,SKU,ORDER_QTY,DP_NO,STATUS,PICK_UP_LOC,LAST_UPD_USR,LAST_UPD_DT,LAST_UPD_VER,ALLOCATE_QTY,PO_NO,CUR_URET,ROWGUID) "
                + "VALUES"
                + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
                + "newid()"
                + ")";

        preparedStatement = dbConnection.prepareStatement(insertTableSQL);

        preparedStatement.setString(1, rstxdate);
        preparedStatement.setString(2, rsloccode);
        preparedStatement.setString(3, rsregno);
        preparedStatement.setString(4, rstxno);
        preparedStatement.setString(5, rsseqno);
        preparedStatement.setString(6, rseventid);
        preparedStatement.setString(7, rssku);
        preparedStatement.setString(8, rsorderqty);
        preparedStatement.setString(9, rsdpno);
        preparedStatement.setString(10, rsstatus);
        preparedStatement.setString(11, rspickuploc);
        preparedStatement.setString(12, rslastupdusr);
        preparedStatement.setTimestamp(13, rslastupddt);
        preparedStatement.setString(14, rslastupdver);
        preparedStatement.setString(15, rsallocateqty);
        preparedStatement.setString(16, rspono);
        preparedStatement.setString(17, rscururet);

      } else {
        // dbConnection = OracleTo.getDBConnection();

        HikariQracleTo OrcaleFromTo = HikariQracleTo.getInstance();
        dbConnection = OrcaleFromTo.getConnection();

        insertTableSQL =
            "INSERT INTO PRESELL_ITEM_STATUS"
                + "(TX_DATE,LOC_CODE,REG_NO,TX_NO,SEQ_NO,EVENT_ID,SKU,ORDER_QTY,DP_NO,STATUS,PICK_UP_LOC,LAST_UPD_USR,LAST_UPD_DT,LAST_UPD_VER,ALLOCATE_QTY,PO_NO,CUR_URET,ROWGUID) "
                + "VALUES"
                + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

        preparedStatement = dbConnection.prepareStatement(insertTableSQL);

        preparedStatement.setString(1, rstxdate);
        preparedStatement.setString(2, rsloccode);
        preparedStatement.setString(3, rsregno);
        preparedStatement.setString(4, rstxno);
        preparedStatement.setString(5, rsseqno);
        preparedStatement.setString(6, rseventid);
        preparedStatement.setString(7, rssku);
        preparedStatement.setString(8, rsorderqty);
        preparedStatement.setString(9, rsdpno);
        preparedStatement.setString(10, rsstatus);
        preparedStatement.setString(11, rspickuploc);
        preparedStatement.setString(12, rslastupdusr);
        preparedStatement.setTimestamp(13, rslastupddt);
        preparedStatement.setString(14, rslastupdver);
        preparedStatement.setString(15, rsallocateqty);
        preparedStatement.setString(16, rspono);
        preparedStatement.setString(17, rscururet);
        preparedStatement.setString(18, rsrowguid);
      }

      preparedStatement.executeUpdate();
      return result;

    } catch (SQLException e) {

      logger.info(e.getMessage());
      result = false;
      return result;

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }
  public static boolean Presellitemstatuschkexists(String entitykey, String frdatabase)
      throws SQLException {

    String[] parts = entitykey.split(",");
    String txdate = parts[0];
    String loccode = parts[1];
    String regno = parts[2];
    String txno = parts[3];
    String seqno = parts[4];

    boolean result = false;
    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;

    try {

      if (Objects.equals(frdatabase, "Oracle")) {
        // dbConnection = Merge.getDBConnection();

        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();
      } else {
        // dbConnection = OracleTo.getDBConnection();

        HikariQracleTo OrcaleFromTo = HikariQracleTo.getInstance();
        dbConnection = OrcaleFromTo.getConnection();
      }

      String selectSQL =
          "SELECT TX_DATE "
              + "FROM presell_item_status "
              + "where TX_DATE ='"
              + txdate
              + "'"
              + "and LOC_CODE ='"
              + loccode
              + "'"
              + "and REG_NO='"
              + regno
              + "'"
              + "and TX_NO ='"
              + txno
              + "'"
              + "and SEQ_NO ='"
              + seqno
              + "'";

      // logger.info(selectSQL);

      preparedStatement = dbConnection.prepareStatement(selectSQL);
      ResultSet rs = preparedStatement.executeQuery();

      while (rs.next()) {
        String rschktxdate = rs.getString("TX_DATE");

        if (rschktxdate != null) {
          result = true; // not exists
        }
      }
      return result;

    } catch (SQLException e) {

      logger.info(e.getMessage());
      result = false;
      return result;

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }
  public static boolean Presellitemstatusupdate(
      String rstxdate,
      String rsloccode,
      String rsregno,
      String rstxno,
      String rsseqno,
      String rseventid,
      String rssku,
      String rsorderqty,
      String rsdpno,
      String rsstatus,
      String rspickuploc,
      String rslastupdusr,
      Timestamp rslastupddt,
      String rslastupdver,
      String rsallocateqty,
      String rspono,
      String rscururet,
      String rsrowguid,
      String frdatabase)
      throws SQLException {

    boolean result = true;
    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;

    try {

      if (Objects.equals(frdatabase, "Oracle")) {
        // dbConnection = Merge.getDBConnection();

        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();
      } else {
        // dbConnection = OracleTo.getDBConnection();

        HikariQracleTo OrcaleFromTo = HikariQracleTo.getInstance();
        dbConnection = OrcaleFromTo.getConnection();
      }

      String updateSQL =
          "UPDATE PRESELL_ITEM_STATUS "
              + "SET  EVENT_ID     = ? "
              + ", SKU          = ? "
              + ", ORDER_QTY    = ? "
              + ", DP_NO        = ? "
              + ", STATUS       = ? "
              + ", PICK_UP_LOC  = ? "
              + ", LAST_UPD_USR = ? "
              + ", LAST_UPD_DT  = ? "
              + ", LAST_UPD_VER = ? "
              + ", ALLOCATE_QTY = ? "
              + ", PO_NO        = ? "
              + ", CUR_URET     = ? "
              + ", ROWGUID      = ? "
              + "WHERE TX_DATE    = ? "
              + "AND LOC_CODE     = ? "
              + "AND REG_NO       = ? "
              + "AND TX_NO        = ? "
              + "AND SEQ_NO       = ? ";

      preparedStatement = dbConnection.prepareStatement(updateSQL);

      preparedStatement.setString(1, rseventid);
      preparedStatement.setString(2, rssku);
      preparedStatement.setString(3, rsorderqty);
      preparedStatement.setString(4, rsdpno);
      preparedStatement.setString(5, rsstatus);
      preparedStatement.setString(6, rspickuploc);
      preparedStatement.setString(7, rslastupdusr);
      preparedStatement.setTimestamp(8, rslastupddt);
      preparedStatement.setString(9, rslastupdver);
      preparedStatement.setString(10, rsallocateqty);
      preparedStatement.setString(11, rspono);
      preparedStatement.setString(12, rscururet);
      preparedStatement.setString(13, rsrowguid);
      preparedStatement.setString(14, rstxdate);
      preparedStatement.setString(15, rsloccode);
      preparedStatement.setString(16, rsregno);
      preparedStatement.setString(17, rstxno);
      preparedStatement.setString(18, rsseqno);

      // logger.info(updateSQL);

      preparedStatement.executeUpdate();
      return result;

    } catch (SQLException e) {

      logger.info(e.getMessage());
      result = false;

      logger.info(result);
      return result;

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }
Exemple #4
0
  public static void routeSagoatxn(
      String dataupdatelog, String entityname, String entitykey, String database)
      throws SQLException {

    String[] parts = entitykey.split(",");
    String txdate = parts[0];
    String loccode = parts[1];
    String regno = parts[2];
    String txno = parts[3];
    String seqno = parts[4];

    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;

    String selectSQL =
        "SELECT TX_DATE,LOC_CODE,REG_NO,TX_NO,SEQ_NO,TX_TYPE,PURPOSE_CDE,STATUS,VOID,SKU,QTY,CUR_URET,STAFF_ID,ROWGUID,LAST_UPD_DT "
            + "from SAGOA_TXN "
            + "where tx_date ='"
            + txdate
            + "'"
            + "and LOC_CODE ='"
            + loccode
            + "'"
            + "and reg_no='"
            + regno
            + "'"
            + "and tx_no ='"
            + txno
            + "'"
            + "and seq_no ='"
            + seqno
            + "'"
            + "Order BY LAST_UPD_DT";

    // List<Sagoatxn> Sagoatxns = new ArrayList<Sagoatxn>();

    try {
      if (Objects.equals(database, "Oracle")) {
        HikariQracleFrom OrcaleFrompool = HikariQracleFrom.getInstance();
        dbConnection = OrcaleFrompool.getConnection();
      } else {
        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();
      }

      preparedStatement = dbConnection.prepareStatement(selectSQL);
      ResultSet rs = preparedStatement.executeQuery();
      while (rs.next()) {

        // Sagoatxn Sagoatxn = new Sagoatxn();

        String rstxdate = rs.getString("TX_DATE");
        String rsloccode = rs.getString("LOC_CODE");
        String rsregno = rs.getString("REG_NO");
        String rstxno = rs.getString("TX_NO");
        String rsseqno = rs.getString("SEQ_NO");
        String rstxtype = rs.getString("TX_TYPE");
        String rspurposecde = rs.getString("PURPOSE_CDE");
        String rsstatus = rs.getString("STATUS");
        String rsvoid = rs.getString("VOID");
        String rssku = rs.getString("SKU");
        String rsqty = rs.getString("QTY");
        String rscururet = rs.getString("CUR_URET");
        String rsstaffid = rs.getString("STAFF_ID");
        String rsrowguid = rs.getString("ROWGUID");
        Timestamp rslastupddt = rs.getTimestamp("LAST_UPD_DT");

        boolean Chkresult = InsertSagoatxn.Sagoatxnchkexists(entitykey, database);

        // logger.info(Chkresult);

        if (!Chkresult) {

          // logger.info("insert");

          boolean Insertresult =
              InsertSagoatxn.Sagoatxninsert(
                  rstxdate,
                  rsloccode,
                  rsregno,
                  rstxno,
                  rsseqno,
                  rstxtype,
                  rspurposecde,
                  rsstatus,
                  rsvoid,
                  rssku,
                  rsqty,
                  rscururet,
                  rsstaffid,
                  rsrowguid,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info("Sagoatxn: 1 row has been inserted. Key:" + entitykey);
          } else {
            logger.info("Insert Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/

        } else {

          // logger.info("update");

          boolean Insertresult =
              InsertSagoatxn.Sagoatxnupdate(
                  rstxdate,
                  rsloccode,
                  rsregno,
                  rstxno,
                  rsseqno,
                  rstxtype,
                  rspurposecde,
                  rsstatus,
                  rsvoid,
                  rssku,
                  rsqty,
                  rscururet,
                  rsstaffid,
                  rsrowguid,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info("Sagoatxn: 1 row has been updated. Key:" + entitykey);
          } else {
            logger.info("Update Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/
        }
      }
    } catch (SQLException e) {

      logger.info(e.getMessage());

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }
Exemple #5
0
  public static void routeGrorgtender(
      String dataupdatelog, String entityname, String entitykey, String database)
      throws SQLException {

    String[] parts = entitykey.split(",");
    String txdate = parts[0];
    String loccode = parts[1];
    String regno = parts[2];
    String txno = parts[3];
    String seqno = parts[4];

    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;

    String selectSQL =
        "SELECT TX_DATE,LOC_CODE,REG_NO,TX_NO,SEQ_NO,VOID,"
            + "TENDER,AMOUNT,REF_NO,ROWGUID,HOLDER_NAME,CARD_EXPIRY,LAST_UPD_DT "
            + "from GR_ORG_TENDER "
            + "where TX_DATE ='"
            + txdate
            + "'"
            + "and LOC_CODE ='"
            + loccode
            + "'"
            + "and reg_no='"
            + regno
            + "'"
            + "and tx_no ='"
            + txno
            + "'"
            + "and seq_no ='"
            + seqno
            + "'"
            + "Order BY LAST_UPD_DT";

    // List<Grorgtender> Grorgtenders = new ArrayList<Grorgtender>();

    try {
      if (Objects.equals(database, "Oracle")) {
        HikariQracleFrom OrcaleFrompool = HikariQracleFrom.getInstance();
        dbConnection = OrcaleFrompool.getConnection();
      } else {
        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();
      }

      preparedStatement = dbConnection.prepareStatement(selectSQL);
      ResultSet rs = preparedStatement.executeQuery();
      while (rs.next()) {

        // Grorgtender Grorgtender = new Grorgtender();

        String rstxdate = rs.getString("TX_DATE");
        String rsloccode = rs.getString("LOC_CODE");
        String rsregno = rs.getString("REG_NO");
        String rstxno = rs.getString("TX_NO");
        String rsseqno = rs.getString("SEQ_NO");
        String rsvoid = rs.getString("VOID");
        String rstender = rs.getString("TENDER");
        String rsamount = rs.getString("AMOUNT");
        String rsrefno = rs.getString("REF_NO");
        String rsrowguid = rs.getString("ROWGUID");
        String rsholdername = rs.getString("HOLDER_NAME");
        String rscardexpiry = rs.getString("CARD_EXPIRY");
        Timestamp rslastupddt = rs.getTimestamp("LAST_UPD_DT");

        boolean Chkresult = InsertGrorgtender.Grorgtenderchkexists(entitykey, database);

        // logger.info(Chkresult);

        if (!Chkresult) {

          // logger.info("insert");

          boolean Insertresult =
              InsertGrorgtender.Grorgtenderinsert(
                  rstxdate,
                  rsloccode,
                  rsregno,
                  rstxno,
                  rsseqno,
                  rsvoid,
                  rstender,
                  rsamount,
                  rsrefno,
                  rsrowguid,
                  rsholdername,
                  rscardexpiry,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info(
                "Grorgtender: 1 row has been inserted. Key:"
                    + rstxdate
                    + ","
                    + rsloccode
                    + ","
                    + rsregno
                    + "'"
                    + rstxno
                    + "'"
                    + rsseqno);
          } else {
            logger.info("Insert Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/

        } else {

          // logger.info("update");

          boolean Insertresult =
              InsertGrorgtender.Grorgtenderupdate(
                  rstxdate,
                  rsloccode,
                  rsregno,
                  rstxno,
                  rsseqno,
                  rsvoid,
                  rstender,
                  rsamount,
                  rsrefno,
                  rsrowguid,
                  rsholdername,
                  rscardexpiry,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info(
                "Grorgtender: 1 row has been updated. Key:"
                    + rstxdate
                    + ","
                    + rsloccode
                    + ","
                    + rsregno
                    + "'"
                    + rstxno
                    + "'"
                    + rsseqno);
          } else {
            logger.info("Update Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/
        }
      }
    } catch (SQLException e) {

      logger.info(e.getMessage());

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }
Exemple #6
0
  public static void routeReason(
      String dataupdatelog, String entityname, String entitykey, String database)
      throws SQLException {

    String[] parts = entitykey.split(",");
    String reasongroup = parts[0];
    String reason = parts[1];

    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;

    String selectSQL =
        "SELECT REASON_GROUP,REASON,REASON_DESC,REASON_DISP,EFF_FR_DATE,EFF_TO_DATE,VOID,ROWGUID,LAST_UPD_DT "
            + "from REASON "
            + "where REASON_GROUP ='"
            + reasongroup
            + "'"
            + "and REASON ='"
            + reason
            + "'"
            + "Order BY LAST_UPD_DT";

    // List<Reason> Reasons = new ArrayList<Reason>();

    try {
      if (Objects.equals(database, "Oracle")) {
        HikariQracleFrom OrcaleFrompool = HikariQracleFrom.getInstance();
        dbConnection = OrcaleFrompool.getConnection();
      } else {
        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();
      }

      preparedStatement = dbConnection.prepareStatement(selectSQL);
      ResultSet rs = preparedStatement.executeQuery();
      while (rs.next()) {

        // Reason Reason = new Reason();

        String rsreasongroup = rs.getString("REASON_GROUP");
        String rsreason = rs.getString("REASON");
        String rsreasondesc = rs.getString("REASON_DESC");
        String rsreasondisp = rs.getString("REASON_DISP");
        String rsefffrdate = rs.getString("EFF_FR_DATE");
        String rsefftodate = rs.getString("EFF_TO_DATE");
        String rsvoid = rs.getString("VOID");
        String rsrowguid = rs.getString("ROWGUID");
        Timestamp rslastupddt = rs.getTimestamp("LAST_UPD_DT");

        boolean Chkresult = InsertReason.Reasonchkexists(entitykey, database);

        // logger.info(Chkresult);

        if (!Chkresult) {

          // logger.info("insert");

          boolean Insertresult =
              InsertReason.Reasoninsert(
                  rsreasongroup,
                  rsreason,
                  rsreasondesc,
                  rsreasondisp,
                  rsefffrdate,
                  rsefftodate,
                  rsvoid,
                  rsrowguid,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info("Reason: 1 row has been inserted. Key:" + reasongroup + "," + reason);
          } else {
            logger.info("Insert Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/

        } else {

          // logger.info("update");

          boolean Insertresult =
              InsertReason.Reasonupdate(
                  rsreasongroup,
                  rsreason,
                  rsreasondesc,
                  rsreasondisp,
                  rsefffrdate,
                  rsefftodate,
                  rsvoid,
                  rsrowguid,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info("Reason: 1 row has been updated. Key:" + reasongroup + "," + reason);
          } else {
            logger.info("Update Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/
        }
      }
    } catch (SQLException e) {

      logger.info(e.getMessage());

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }
Exemple #7
0
  public static void routeGrorgdet(
      String dataupdatelog, String entityname, String entitykey, String database)
      throws SQLException {

    String[] parts = entitykey.split(",");
    String txdate = parts[0];
    String loccode = parts[1];
    String regno = parts[2];
    String txno = parts[3];
    String seqno = parts[4];

    Connection dbConnection = null;
    PreparedStatement preparedStatement = null;

    String selectSQL =
        "SELECT TX_DATE,LOC_CODE,REG_NO,TX_NO,SEQ_NO,"
            + "VOID,QTY,ORG_TX_DATE,ORG_LOC_CODE,ORG_REG_NO,ORG_TX_NO,"
            + "ORG_SEQ_NO,VALIDATED,NET_SALE,NET_DISC,ROWGUID,PURPOSE,VIP_NO,VIP_NAME,LAST_UPD_DT from GR_ORG_DET "
            + "where TX_DATE ='"
            + txdate
            + "'"
            + "and LOC_CODE ='"
            + loccode
            + "'"
            + "and reg_no='"
            + regno
            + "'"
            + "and tx_no ='"
            + txno
            + "'"
            + "and seq_no ='"
            + seqno
            + "'"
            + "Order BY LAST_UPD_DT";

    // List<Grorgdet> Grorgdets = new ArrayList<Grorgdet>();

    try {
      if (Objects.equals(database, "Oracle")) {
        HikariQracleFrom OrcaleFrompool = HikariQracleFrom.getInstance();
        dbConnection = OrcaleFrompool.getConnection();
      } else {
        HikariMerge Mergepool = HikariMerge.getInstance();
        dbConnection = Mergepool.getConnection();
      }

      preparedStatement = dbConnection.prepareStatement(selectSQL);
      ResultSet rs = preparedStatement.executeQuery();
      while (rs.next()) {

        // Grorgdet Grorgdet = new Grorgdet();

        String rstxdate = rs.getString("TX_DATE");
        String rsloccode = rs.getString("LOC_CODE");
        String rsregno = rs.getString("REG_NO");
        String rstxno = rs.getString("TX_NO");
        String rsseqno = rs.getString("SEQ_NO");
        String rsvoid = rs.getString("VOID");
        String rsqty = rs.getString("QTY");
        String rsorgtxdate = rs.getString("ORG_TX_DATE");
        String rsorgloccode = rs.getString("ORG_LOC_CODE");
        String rsorgregno = rs.getString("ORG_REG_NO");
        String rsorgtxno = rs.getString("ORG_TX_NO");
        String rsorgseqno = rs.getString("ORG_SEQ_NO");
        String rsvalidated = rs.getString("VALIDATED");
        String rsnetsale = rs.getString("NET_SALE");
        String rsnetdisc = rs.getString("NET_DISC");
        String rsrowguid = rs.getString("ROWGUID");
        String rspurpose = rs.getString("PURPOSE");
        String rsvipno = rs.getString("VIP_NO");
        String rsvipname = rs.getString("VIP_NAME");
        Timestamp rslastupddt = rs.getTimestamp("LAST_UPD_DT");

        boolean Chkresult = InsertGrorgdet.Grorgdetchkexists(entitykey, database);

        // logger.info(Chkresult);

        if (!Chkresult) {

          // logger.info("insert");

          boolean Insertresult =
              InsertGrorgdet.Grorgdetinsert(
                  rstxdate,
                  rsloccode,
                  rsregno,
                  rstxno,
                  rsseqno,
                  rsvoid,
                  rsqty,
                  rsorgtxdate,
                  rsorgloccode,
                  rsorgregno,
                  rsorgtxno,
                  rsorgseqno,
                  rsvalidated,
                  rsnetsale,
                  rsnetdisc,
                  rsrowguid,
                  rspurpose,
                  rsvipno,
                  rsvipname,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info(
                "Grorgdet: 1 row has been inserted. Key:"
                    + rstxdate
                    + ","
                    + rsloccode
                    + ","
                    + rsregno
                    + "'"
                    + rstxno
                    + "'"
                    + rsseqno);
          } else {
            logger.info("Insert Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/

        } else {

          // logger.info("update");

          boolean Insertresult =
              InsertGrorgdet.Grorgdetupdate(
                  rstxdate,
                  rsloccode,
                  rsregno,
                  rstxno,
                  rsseqno,
                  rsvoid,
                  rsqty,
                  rsorgtxdate,
                  rsorgloccode,
                  rsorgregno,
                  rsorgtxno,
                  rsorgseqno,
                  rsvalidated,
                  rsnetsale,
                  rsnetdisc,
                  rsrowguid,
                  rspurpose,
                  rsvipno,
                  rsvipname,
                  rslastupddt,
                  database);

          if (Insertresult) {
            logger.info(
                "Grorgdet: 1 row has been updated. Key:"
                    + rstxdate
                    + ","
                    + rsloccode
                    + ","
                    + rsregno
                    + "'"
                    + rstxno
                    + "'"
                    + rsseqno);
          } else {
            logger.info("Update Error");
          }
          Logupdateresult.Updatelogresult(dataupdatelog, entityname, Insertresult, database);

          /*if ((!"Oracle".equals(database)) && (Insertresult)) {
          	Insertdataupdatelog.Updatelogresult(entityname, entitykey);
          }*/
        }
      }
    } catch (SQLException e) {

      logger.info(e.getMessage());

    } finally {

      if (preparedStatement != null) {
        preparedStatement.close();
      }

      if (dbConnection != null) {
        dbConnection.close();
      }
    }
  }