Example usage for java.sql CallableStatement setNull

List of usage examples for java.sql CallableStatement setNull

Introduction

In this page you can find the example usage for java.sql CallableStatement setNull.

Prototype

void setNull(String parameterName, int sqlType) throws SQLException;

Source Link

Document

Sets the designated parameter to SQL NULL.

Usage

From source file:com.ibm.ioes.dao.ReportsDao_Usage.java

/**
* 
* @param objDto//from  www . ja  v a 2  s.c om
* @return
* @throws Exception
*/
public ArrayList<ActiveLineItemReportsDTO> viewActiveLineItemsList(ActiveLineItemReportsDTO objDto)
        throws Exception {

    //Nagarjuna
    String methodName = "viewActiveLineItemsList", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end Nagarjuna
    ArrayList<ActiveLineItemReportsDTO> objUserList = new ArrayList<ActiveLineItemReportsDTO>();
    Connection conn = null;
    CallableStatement proc = null;
    ResultSet rs = null;
    int recordCount = 0;
    Utility utility = new Utility();
    DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    Date tempDate = null;
    Timestamp ts = null;
    try {

        conn = DbConnection.getReportsConnectionObject();

        proc = conn.prepareCall(sqlActiveLineItemsForUsage);
        proc.setInt(1, java.sql.Types.BIGINT);
        if (objDto.getOrderType() != null && !"".equals(objDto.getOrderType())) {
            proc.setString(2, objDto.getOrderType().trim());
        } else {
            proc.setNull(2, java.sql.Types.VARCHAR);
        }
        if (objDto.getFromDate() != null && !"".equals(objDto.getFromDate())) {
            SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr = formatter.parse(objDto.getFromDate());
            String formattedDate = formatter.format(dateStr);
            Date date1 = formatter.parse(formattedDate);
            formatter = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate = formatter.format(date1);
            proc.setString(3, formattedDate);
            //proc.setString(2, objDto.getFromDate().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }
        if (objDto.getToDate() != null && !"".equals(objDto.getToDate())) {
            SimpleDateFormat formatter1 = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr1 = formatter1.parse(objDto.getToDate());
            String formattedDate1 = formatter1.format(dateStr1);
            Date date2 = formatter1.parse(formattedDate1);
            formatter1 = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate1 = formatter1.format(date2);
            proc.setString(4, formattedDate1);
        } else {
            proc.setNull(4, java.sql.Types.VARCHAR);
        }

        if (objDto.getFromOrderNo() != 0 && !"".equals(objDto.getFromOrderNo())) {
            proc.setInt(5, objDto.getFromOrderNo());
        } else {
            proc.setNull(5, java.sql.Types.BIGINT);
        }
        if (objDto.getToOrderNo() != 0 && !"".equals(objDto.getToOrderNo())) {
            proc.setInt(6, objDto.getToOrderNo());
        } else {
            proc.setNull(6, java.sql.Types.BIGINT);
        }
        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(7, pagingSorting.getSortByColumn());// columnName
        proc.setString(8, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(9, pagingSorting.getStartRecordId());// start index
        proc.setInt(10, pagingSorting.getEndRecordId());// end index
        proc.setInt(11, (pagingSorting.isPagingToBeDone() ? 1 : 0));// end
        // index
        proc.setInt(12, (objDto.getIsUsage()));// end

        if (objDto.getFromCopcApprovedDate() != null && !"".equals(objDto.getFromCopcApprovedDate())) {
            SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr = formatter.parse(objDto.getFromCopcApprovedDate());
            String formattedDate = formatter.format(dateStr);
            Date date1 = formatter.parse(formattedDate);
            formatter = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate = formatter.format(date1);
            proc.setString(13, formattedDate);
            //proc.setString(2, objDto.getFromDate().trim());
        } else {
            proc.setNull(13, java.sql.Types.VARCHAR);
        }
        if (objDto.getToCopcApprovedDate() != null && !"".equals(objDto.getToCopcApprovedDate())) {
            SimpleDateFormat formatter1 = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr1 = formatter1.parse(objDto.getToCopcApprovedDate());
            String formattedDate1 = formatter1.format(dateStr1);
            Date date2 = formatter1.parse(formattedDate1);
            formatter1 = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate1 = formatter1.format(date2);
            proc.setString(14, formattedDate1);
        } else {
            proc.setNull(14, java.sql.Types.VARCHAR);
        }
        if (objDto.getPartyNo() != 0 && !"".equals(objDto.getPartyNo())) {
            proc.setInt(15, objDto.getPartyNo());
        } else {
            proc.setNull(15, java.sql.Types.BIGINT);
        }
        System.out.println("Dao" + objDto.getPartyNo());

        if (objDto.getCustomerSegment() != null && !"".equals(objDto.getCustomerSegment())
                && !objDto.getCustomerSegment().equals("0")) {
            proc.setString(16, objDto.getCustomerSegment());
        } else {
            proc.setNull(16, java.sql.Types.VARCHAR);
        }
        System.out.println("Dao cust " + objDto.getCustomerSegment());
        if (objDto.getProductName() != null && !"".equals(objDto.getProductName())
                && !objDto.getProductName().equals("0")) {
            proc.setString(17, objDto.getProductName());
        } else {
            proc.setNull(17, java.sql.Types.VARCHAR);
        }
        rs = proc.executeQuery();
        int countFlag = 0;
        ActiveLineItemReportsDTO objdto;
        while (rs.next() != false) {
            countFlag++;
            //Added by Ashutosh for Billing Address
            //[270513]Start
            setBlank();
            //replaceSeperator("BILLING_LOCATION",rs.getString("BILLING_ADDRESS"));
            replaceSeperator("PRIMARYLOCATION", rs.getString("PRIMARYLOCATION"));
            replaceSeperator("SECONDARYLOCATION", rs.getString("SECONDARYLOCATION"));

            objdto = new ActiveLineItemReportsDTO();
            objdto.setLogicalSINo(rs.getString("LOGICAL_SI_NO"));
            objdto.setCustSINo(rs.getString("CUSTOMER_LOGICAL_SI_NO"));
            objdto.setServiceName(rs.getString("SERVICENAME"));
            //objdto.setLinename(rs.getString("LINENAME"));//PARENT_NAME
            //objdto.setAccountID(rs.getInt("ACCOUNTID"));//CUSTACCOUNTID
            objdto.setCreditPeriodName(rs.getString("CREDIT_PERIODNAME"));
            //objdto.setCurrencyName(rs.getString("CURNAME"));//CURRENCYNAME
            objdto.setEntity(rs.getString("ENTITYNAME"));
            objdto.setBillingMode(rs.getString("BILLINGMODE"));
            objdto.setBillingTypeName(rs.getString("BILLING_TYPENAME"));
            objdto.setBillingformat(rs.getString("BILLING_FORMATNAME"));
            objdto.setLicCompanyName(rs.getString("LCOMPANYNAME"));
            objdto.setTaxation(rs.getString("TAXATIONVALUE"));
            objdto.setBillingLevelName(rs.getString("BILLING_LEVELNAME"));
            objdto.setBillingLevelNo(rs.getLong("BILLING_LEVEL_NO"));
            //objdto.setPoNumber(rs.getInt("PODETAILNUMBER"));//PONUMBER
            Date temDate = rs.getDate("PODATE");
            if (temDate != null) {
                objdto.setPoDate((Utility.showDate_Report(temDate)).toUpperCase());
            }
            objdto.setParty_num(rs.getString("PARTY_NO"));
            objdto.setBillingTriggerFlag(rs.getString("BILLING_TRIGGER_FLAG"));
            /*objdto.setPm_pro_date(rs.getString("PM_PROVISIONING_DATE"));//Pm_Prov_Date
            if (rs.getString("PM_PROVISIONING_DATE") != null && !"".equals(rs.getString("PM_PROVISIONING_DATE")))
            {
                 String s1=rs.getString("PM_PROVISIONING_DATE");
                 String s3=s1.substring(0,7).toUpperCase();
                 String s4=s1.substring(9,11);
                 String s5=s3.concat(s4);
                 objdto.setPm_pro_date(s5);
            }*/
            objdto.setLocDate(rs.getString("LOCDATE"));
            if (rs.getString("LOCDATE") != null && !"".equals(rs.getString("LOCDATE"))) {

                Date date = df.parse(objdto.getLocDate());
                objdto.setLocDate((utility.showDate_Report(date)).toUpperCase());
            }
            objdto.setBilling_trigger_date(rs.getString("BILLINGTRIGGERDATE"));
            if (rs.getString("BILLINGTRIGGERDATE") != null && !"".equals(rs.getString("BILLINGTRIGGERDATE"))) {

                Date date = df.parse(objdto.getBilling_trigger_date());
                objdto.setBilling_trigger_date((utility.showDate_Report(date)).toUpperCase());
            }
            //objdto.setFx_external_acc_id(rs.getString("FX_ACCOUNT_EXTERNAL_ID"));//Child_Account_Number
            objdto.setChild_account_creation_status(rs.getString("Child_account_FX_sataus"));

            tempDate = rs.getDate("ORDERDATE");
            if (tempDate != null) {
                objdto.setOrderDate((Utility.showDate_Report(tempDate)).toUpperCase());
            }
            /*objdto.setCopcapprovaldate(rs.getString("APPROVAL_DATE"));//ORDER_APPROVED_DATE
            if (rs.getString("APPROVAL_DATE") != null && !"".equals(rs.getString("APPROVAL_DATE")))
            {
               objdto.setCopcapprovaldate((utility.showDate_Report(new Date(rs.getTimestamp("APPROVAL_DATE").getTime()))).toUpperCase());
            }*/
            objdto.setOrderType(rs.getString("ORDERTYPE"));
            ts = rs.getTimestamp("BILLING_TRIGGER_CREATEDATE");
            if (ts != null) {
                tempDate = new Date(ts.getTime());
                objdto.setBillingtrigger_createdate(Utility.showDate_Report(tempDate).toUpperCase());
            }
            objdto.setProductName(rs.getString("PRODUCTNAME"));
            objdto.setSubProductName(rs.getString("SUBPRODUCTNAME"));
            objdto.setServiceStage(rs.getString("SERVICE_STAGE"));
            objdto.setOrderStage(rs.getString("STAGE"));
            /*objdto.setRfsDate(rs.getString("RFS_DATE"));//SERVICE_RFS_DATE
            if (rs.getString("RFS_DATE") != null && !"".equals(rs.getString("RFS_DATE")))
            {
               objdto.setRfsDate((utility.showDate_Report(new Date(rs.getTimestamp("RFS_DATE").getTime()))).toUpperCase());
            }*/
            tempDate = rs.getDate("PORECEIVEDATE");
            if (rs.getString("PORECEIVEDATE") != null && !"".equals(rs.getString("PORECEIVEDATE"))) {
                objdto.setPoReceiveDate((Utility.showDate_Report(tempDate)).toUpperCase());
            }
            objdto.setCustPoDetailNo(rs.getString("CUSTPONUMBER"));
            //objdto.setCustPoDate(rs.getString("CUST_PODATE"));//PORECEIVEDATE
            /*if (rs.getString("CUST_PODATE") != null && !"".equals(rs.getString("CUST_PODATE")))
            {
               Date date=df.parse(objdto.getCustPoDate());
               objdto.setCustPoDate((utility.showDate_Report(date)).toUpperCase());
            }*/

            objdto.setM6cktid(rs.getString("CKTID"));
            objdto.setOrdersubtype(rs.getString("ORDERSUBTYPE"));
            objdto.setRegion(rs.getString("REGIONNAME"));//Added in View Componet  :AKS
            objdto.setBandwaidth(rs.getString("BANDWIDTH"));
            objdto.setVertical(rs.getString("VERTICAL_DETAILS"));
            objdto.setAccountManager(rs.getString("ACCOUNTMANAGER"));
            objdto.setProjectManager(rs.getString("PROJECTMANAGER"));
            objdto.setPartyName(rs.getString("PARTYNAME"));
            //objdto.setBilling_location_from(rs.getString("BILLING_LOCATION"));//BILLING_ADDRESS
            //objdto.setDemo(rs.getString("DEMO_ORDER"));//Demo_Type
            //objdto.setToLocation(rs.getString("FROM_LOCATION"));//FROM_ADDRESS
            //objdto.setFromLocation(rs.getString("TO_LOCATION"));//TO_ADDRESS
            objdto.setBilling_bandwidth(rs.getString("BILLING_BANDWIDTH"));
            objdto.setBilling_uom(rs.getString("BILLING_BANDWIDTH_UOM"));
            objdto.setServiceproductid(rs.getInt("ORDER_LINE_ID"));
            objdto.setOrderNumber(rs.getInt("ORDERNO"));
            objdto.setContractPeriod(rs.getInt("CONTRACTPERIOD"));
            //objdto.setTotalPoAmt(""+rs.getDouble("TOTAL_POAMOUNT"));//ORDERTOTAL
            objdto.setParty_id(rs.getInt("PARTY_ID"));
            objdto.setCrmAccountNoString(rs.getString("CRMACCOUNTNO"));
            //objdto.setServiceId(rs.getInt("SERVICEID"));//SERVICE_NO
            //[111] START
            objdto.setMainSpid(rs.getLong("MAIN_SERVICEPRODUCTID"));
            objdto.setTaxExemptReasonName(rs.getString("REASONNAME"));
            //[111] end
            //[003] Start
            objdto.setServiceSegment(rs.getString("ACCOUNTCATEGORY_DETAILS"));
            //[003] end

            //[004] rahul Start
            objdto.setChargeRedirectionLSI(rs.getString("FX_REDIRECTION_LSI"));
            //[004] rahul end

            //[005] Start
            objdto.setInstallationFromCity(rs.getString("INSTALLATION_FROM_CITY"));
            objdto.setInstallationToCity(rs.getString("INSTALLATION_TO_CITY"));
            objdto.setInstallationFromState(rs.getString("INSTALLATION_FROM_STATE"));
            objdto.setInstallationToState(rs.getString("INSTALLATION_TO_STATE"));
            objdto.setBillingContactName(rs.getString("BILLING_CONTACT_NAME"));
            objdto.setBillingContactNumber(rs.getString("BILLING_CONTACT_NUMBER"));
            objdto.setBillingEmailId(rs.getString("BILLING_EMAIL_ID"));
            //[005] End

            //[006] Start
            objdto.setStandardReason(rs.getString("STANDARDREASON"));
            objdto.setLdClause(rs.getString("LDCLAUSE"));
            //[006] End

            //Saurabh : Changes for Usage for storing charge data
            if (objDto.getIsUsage() == 0) {
                objdto.setChargeTypeName(rs.getString("CHARGETYPE"));
                objdto.setChargeTypeID(rs.getInt("CHARGETYPEID"));
                objdto.setChargeName(rs.getString("CHARGE_NAME"));
                objdto.setChargeFrequency(rs.getString("FREQUENCYNAME"));
                objdto.setBillPeriod(rs.getString("BILL_PERIOD"));
                objdto.setStartDate(rs.getString("START_DATE"));
                if (rs.getString("START_DATE") != null && !"".equals(rs.getString("START_DATE"))) {

                    Date date = df.parse(objdto.getStartDate());
                    objdto.setStartDate((utility.showDate_Report(date)).toUpperCase());
                }
                objdto.setStore(rs.getString("STORENAME"));
                objdto.setHardwaretypeName(rs.getString("HARDWARETYPENAME"));
                objdto.setFormAvailable(rs.getString("FORM_C_AVAILABLE"));
                objdto.setSaleNature(rs.getString("SALENATURENAME"));
                objdto.setSaleTypeName(rs.getString("SALETYPENAME"));
                objdto.setPrimaryLocation(rs.getString("PRIMARYLOCATION"));
                objdto.setSeclocation(rs.getString("SECONDARYLOCATION"));
                objdto.setChargeAnnotation(rs.getString("ANNOTATION"));
                objdto.setFx_sd_charge_status(rs.getString("FX_SD_CHG_SATATUS"));
                objdto.setFx_charge_status(rs.getString("FX_STATUS"));
                objdto.setFx_Ed_Chg_Status(rs.getString("FX_ED_CHARGE_STATUS"));
                objdto.setTokenID(rs.getInt("TOKEN_ID"));
                objdto.setModifiedDate(rs.getString("LAST_UPDATE_DATE"));
                if (rs.getString("LAST_UPDATE_DATE") != null && !"".equals(rs.getString("LAST_UPDATE_DATE"))) {
                    objdto.setModifiedDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("LAST_UPDATE_DATE").getTime())))
                                    .toUpperCase());
                }
                objdto.setChallenno(rs.getString("CHALLEN_NO"));
                objdto.setChallendate(rs.getString("CHALLEN_DATE"));
                if (rs.getString("CHALLEN_DATE") != null && !"".equals(rs.getString("CHALLEN_DATE"))) {
                    String s1 = rs.getString("CHALLEN_DATE");
                    String s3 = s1.substring(0, 7).toUpperCase();
                    String s4 = s1.substring(9, 11);
                    String s5 = s3.concat(s4);
                    objdto.setChallendate(s5);
                }
                objdto.setRatio(rs.getString("RATIO"));
                objdto.setHardwareType(rs.getString("HARDWARE_FLAG"));
                objdto.setCharge_status(rs.getString("CHARGES_STATUS"));
                objdto.setLOC_No(rs.getString("LOCNO"));
                objdto.setAddress1(rs.getString("ADDRESS"));
                objdto.setRate_code(rs.getString("RATECODE"));
                objdto.setDistance(rs.getString("CHARGEABLE_DISTANCE"));
                objdto.setDispatchAddress1(rs.getString("DISPATCH_DETAILS"));
                objdto.setIndicative_value(rs.getString("INDICATIVE_VALUE"));
                objdto.setCrm_productname(rs.getString("CRM_PRODUCTNAME"));
                objdto.setBlSource(rs.getString("BL_SOURCE"));
                objdto.setChargeAmount(rs.getDouble("INV_AMT"));
                objdto.setLineamt(rs.getDouble("LINEITEMAMOUNT"));
                objdto.setChargesSumOfLineitem(rs.getDouble("TOTAL_CHARGE_AMT"));
                objdto.setM6OrderNo(rs.getInt("M6ORDERID"));
                objdto.setCust_total_poamt(rs.getDouble("CUST_TOT_PO_AMT"));
                objdto.setPk_charge_id(rs.getString("PK_CHARGE_ID"));//Added by Ashutosh as on 26-Jun-12
                objdto.setContractPeriod(rs.getInt("CONTRACTPERIOD"));
                objdto.setAnnual_rate(rs.getDouble("ANNUAL_RATE"));
                //Start: Adding Changes 
                objdto.setLinename(rs.getString("LINENAME"));//PARENT_NAME
                objdto.setAccountID(rs.getInt("ACCOUNTID"));//CUSTACCOUNTID               
                objdto.setCurrencyName(rs.getString("CURNAME"));//CURRENCYNAME
                objdto.setPoNumber(rs.getInt("PODETAILNUMBER"));//PONUMBER            
                objdto.setPm_pro_date(rs.getString("PM_PROVISIONING_DATE"));//Pm_Prov_Date
                if (rs.getString("PM_PROVISIONING_DATE") != null
                        && !"".equals(rs.getString("PM_PROVISIONING_DATE"))) {
                    String s1 = rs.getString("PM_PROVISIONING_DATE");
                    String s3 = s1.substring(0, 7).toUpperCase();
                    String s4 = s1.substring(9, 11);
                    String s5 = s3.concat(s4);
                    objdto.setPm_pro_date(s5);
                }
                objdto.setFx_external_acc_id(rs.getString("FX_ACCOUNT_EXTERNAL_ID"));//Child_Account_Number            
                objdto.setCopcapprovaldate(rs.getString("APPROVAL_DATE"));//ORDER_APPROVED_DATE
                if (rs.getString("APPROVAL_DATE") != null && !"".equals(rs.getString("APPROVAL_DATE"))) {
                    objdto.setCopcapprovaldate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("APPROVAL_DATE").getTime())))
                                    .toUpperCase());
                }
                tempDate = rs.getDate("RFS_DATE");
                if (tempDate != null) {
                    objdto.setRfsDate((Utility.showDate_Report(tempDate)).toUpperCase());
                }
                objdto.setCustPoDate(rs.getString("CUST_PODATE"));//PORECEIVEDATE
                if (rs.getString("CUST_PODATE") != null && !"".equals(rs.getString("CUST_PODATE"))) {
                    Date date = df.parse(objdto.getCustPoDate());
                    objdto.setCustPoDate((utility.showDate_Report(date)).toUpperCase());
                }
                objdto.setBilling_location_from(rs.getString("BILLING_LOCATION"));//BILLING_ADDRESS
                objdto.setDemo(rs.getString("DEMO_ORDER"));//Demo_Type
                objdto.setToLocation(rs.getString("FROM_LOCATION"));//FROM_ADDRESS
                objdto.setFromLocation(rs.getString("TO_LOCATION"));//TO_ADDRESS

                objdto.setTotalPoAmt("" + rs.getDouble("TOTAL_POAMOUNT"));//ORDERTOTAL

                objdto.setServiceId(rs.getInt("SERVICEID"));//SERVICE_NO
                objdto.setPoExpiryDate(rs.getString("PO_EXPIRY_DATE"));
                if (rs.getString("PO_EXPIRY_DATE") != null && !"".equals(rs.getString("PO_EXPIRY_DATE"))) {
                    //Date date=df.parse(objdto.getPoExpiryDate());
                    //objdto.setPoExpiryDate((utility.showDate_Report(date)).toUpperCase());
                    objdto.setPoExpiryDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("PO_EXPIRY_DATE").getTime())))
                                    .toUpperCase());

                }
                //END
            }

            // Meenakshi : Changes for Usage for storing component data
            else if (objDto.getIsUsage() == 1) {
                objdto.setFxInternalId(rs.getInt("INTERNAL_ID"));
                objdto.setMinimum_bandwidth(rs.getString("MINIMUM_BANDWIDTH"));//Need to add in View : AKS(Added)
                objdto.setMinimum_bandwidth_UOM(rs.getString("MINIMUM_BANDWIDTH_UOM"));//Need to add in View : AKS(Added)
                objdto.setComponentInfoID(rs.getInt("COMPONENTINFOID"));
                objdto.setComponentID(rs.getInt("COMPONENT_ID"));
                objdto.setComponentName(rs.getString("COMPONENT_NAME"));
                objdto.setPackageID(rs.getInt("PACKAGE_ID"));
                objdto.setPackageName(rs.getString("PACKAGE_NAME"));
                ComponentsDto dto = new ComponentsDto();
                dto.setComponentType(rs.getString("COMPONENT_TYPE"));
                dto.setComponentAmount(rs.getDouble("COMP_AMOUNT"));//RC_NRC_COMP_AMOUNT : AKS
                dto.setComponentStatus(rs.getString("COMPONENT_STATUS"));
                dto.setStartLogic(rs.getString("COMPONENT_START_LOGIC"));
                dto.setStartDate(rs.getString("COMPONENT_START_DATE"));
                if (rs.getString("COMPONENT_START_DATE") != null
                        && !"".equals(rs.getString("COMPONENT_START_DATE"))) {
                    Date date = df.parse(dto.getStartDate());
                    dto.setStartDate((utility.showDate_Report(date)).toUpperCase());
                }
                dto.setEndLogic(rs.getString("COMPONENT_END_LOGIC"));
                dto.setEnd_date(rs.getString("COMPONENT_END_DATE"));
                if (rs.getString("COMPONENT_END_DATE") != null
                        && !"".equals(rs.getString("COMPONENT_END_DATE"))) {
                    Date date = df.parse(dto.getEnd_date());
                    dto.setEnd_date((utility.showDate_Report(date)).toUpperCase());
                }
                dto.setFxTokenNo(rs.getString("START_COMPONENT_TOKEN_NO"));
                dto.setFxStartStatus(rs.getString("SYSTEM_START_STATUS"));
                //dto.setChargesSumOfLineitem(rs.getString("FX_START_COMPONENT_STATUS"));
                dto.setComponentInstanceID(rs.getString("COMPONENT_INST_ID"));//COMP_FX_INSTANCE_ID : AKS
                dto.setEndFxStatus(rs.getString("SYSTEM_END_STATUS"));//FX_END_COMPONENT_STATUS :AKS
                //dto.setStartStatus(rs.getString("FX_ST_COMPONENT_STATUS"));
                objdto.setExternalId(rs.getString("FX_SI_ID"));
                //Start: Adding Changes 
                objdto.setM6OrderNo(rs.getInt("M6ORDERNO"));
                objdto.setLinename(rs.getString("PARENT_NAME"));
                objdto.setAccountID(rs.getInt("CUSTACCOUNTID"));
                objdto.setCurrencyName(rs.getString("CURRENCYNAME"));
                objdto.setPoNumber(rs.getInt("PONUMBER"));
                objdto.setPm_pro_date(rs.getString("Pm_Prov_Date"));
                if (rs.getString("Pm_Prov_Date") != null && !"".equals(rs.getString("Pm_Prov_Date"))) {
                    String s1 = rs.getString("Pm_Prov_Date");
                    String s3 = s1.substring(0, 7).toUpperCase();
                    String s4 = s1.substring(9, 11);
                    String s5 = s3.concat(s4);
                    objdto.setPm_pro_date(s5);
                }
                objdto.setFx_external_acc_id(rs.getString("Child_Account_Number"));
                /*               objdto.setCopcapprovaldate(rs.getString("ORDER_APPROVED_DATE"));
                               if (rs.getString("ORDER_APPROVED_DATE") != null && !"".equals(rs.getString("ORDER_APPROVED_DATE")))
                               {
                                  objdto.setCopcapprovaldate((utility.showDate_Report(new Date(rs.getTimestamp("ORDER_APPROVED_DATE").getTime()))).toUpperCase());
                               }*/

                objdto.setOrderApproveDate(rs.getString("ORDER_APPROVED_DATE"));//Copc date
                tempDate = rs.getDate("ORDER_APPROVED_DATE");
                if (tempDate != null && !"".equals(tempDate)) {
                    objdto.setOrderApproveDate((utility.showDate_Report(tempDate)).toUpperCase());

                }
                objdto.setCopcapprovaldate(rs.getString("COPC_APPROVED_DATE"));
                ts = rs.getTimestamp("COPC_APPROVED_DATE");
                if (ts != null) {
                    tempDate = new Date(ts.getTime());
                    objdto.setCopcapprovaldate((utility.showDate_Report(tempDate)).toUpperCase());

                }

                tempDate = rs.getDate("SERVICE_RFS_DATE");
                if (tempDate != null) {
                    objdto.setRfsDate(Utility.showDate_Report(tempDate).toUpperCase());
                }
                tempDate = rs.getDate("PORECEIVEDATE");
                if (tempDate != null) {

                    objdto.setCustPoDate((Utility.showDate_Report(tempDate)).toUpperCase());
                }
                objdto.setBilling_location_from(VAR_PRIMARYLOCATION);
                objdto.setBilling_location_to(VAR_SECONDARYLOCATION);
                objdto.setDemo(rs.getString("Demo_Type"));
                objdto.setToLocation(rs.getString("TO_ADDRESS"));
                objdto.setFromLocation(rs.getString("FROM_ADDRESS"));

                objdto.setTotalPoAmt("" + rs.getDouble("ORDERTOTAL"));

                objdto.setServiceId(rs.getInt("SERVICE_NO"));
                //nagarjuna PoExpiryDate Modified
                objdto.setPoExpiryDate(rs.getString("PO_EXPIRY_DATE"));
                if (rs.getString("PO_EXPIRY_DATE") != null && !"".equals(rs.getString("PO_EXPIRY_DATE"))) {
                    //Date date=df.parse(objdto.getPoExpiryDate());
                    //objdto.setPoExpiryDate((utility.showDate_Report(date)).toUpperCase());
                    objdto.setPoExpiryDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("PO_EXPIRY_DATE").getTime())))
                                    .toUpperCase());
                }
                //nagarjuna PoExpiryDate Modified End
                //END
                //satyapan OSP/ISP
                objdto.setIsOspRequired(rs.getString("IS_OSP"));
                if (rs.getString("OSP_REG_NO") != null && !"".equals(rs.getString("OSP_REG_NO"))) {
                    objdto.setOspRegistrationNo(rs.getString("OSP_REG_NO"));
                } else {
                    objdto.setOspRegistrationNo("");
                }
                objdto.setOspRegistrationDate(rs.getString("OSP_REG_DATE"));
                if (rs.getString("OSP_REG_DATE") != null && !"".equals(rs.getString("OSP_REG_DATE"))) {
                    objdto.setOspRegistrationDate(
                            (Utility.showDate_Report(new Date(rs.getTimestamp("OSP_REG_DATE").getTime())))
                                    .toUpperCase());
                }
                objdto.setIsIspRequired(rs.getString("ISP_TAGGING"));
                if (rs.getString("ISP_LIC_CTGRY") != null && !"".equals(rs.getString("ISP_LIC_CTGRY"))
                        && !"0".equals(rs.getString("ISP_LIC_CTGRY"))) {
                    objdto.setIspCatageory(rs.getString("ISP_LIC_CTGRY"));
                } else {
                    objdto.setIspCatageory("");
                }

                if (rs.getString("ISP_LIC_NO") != null && !"".equals(rs.getString("ISP_LIC_NO"))) {
                    objdto.setIspLicenseNo(rs.getString("ISP_LIC_NO"));
                } else {
                    objdto.setIspLicenseNo("");
                }
                objdto.setIspLicenseDate(rs.getString("ISP_LIC_DATE"));
                if (rs.getString("ISP_LIC_DATE") != null && !"".equals(rs.getString("ISP_LIC_DATE"))) {
                    objdto.setIspLicenseDate(
                            (Utility.showDate_Report(new Date(rs.getTimestamp("ISP_LIC_DATE").getTime())))
                                    .toUpperCase());
                }

                //End of satyapan OSP/ISP

                objdto.setComponentDto(dto);
            }
            /// End
            //[007] start
            objdto.setSalesForceOpportunityNumber(rs.getString("SF_OPP_ID"));
            objdto.setChannelPartner(rs.getString("PARTNER_NAME"));
            objdto.setNetworkType(rs.getString("NETWORK_SERVICE_TYPE"));
            objdto.setPartnerId(rs.getString("PARTNER_ID"));
            //[007] End
            //[008] start
            objdto.setPartnerCode(rs.getString("PARTNER_CODE"));
            objdto.setFieldEngineer(rs.getString("FIELD_ENGINEER"));
            //NANCY
            objdto.setePCNNo(rs.getString("EPCN_NO"));
            //NANCY      
            //[008] end
            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
                //recordCount = countFlag;
            }
            objUserList.add(objdto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        //ex.printStackTrace();
        //throw new Exception("SQL Exception : " + ex.getMessage(), ex);
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(conn);

        } catch (Exception e) {
            //e.printStackTrace();
            //throw new Exception("Exception : " + e.getMessage(), e);
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        }
    }

    return objUserList;
}

From source file:com.ibm.ioes.dao.ReportsDao_Usage.java

public ArrayList<BillingTriggerDoneButFailedInFXDTO> viewBillingTriggerDoneButFailedInFX(
        BillingTriggerDoneButFailedInFXDTO objDto) {
    //Nagarjuna//w ww.  j a va2  s  . co m
    String methodName = "viewBillingTriggerDoneButFailedInFX", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end Nagarjuna
    Connection connection = null;
    CallableStatement proc = null;
    ResultSet rs = null;
    ArrayList<BillingTriggerDoneButFailedInFXDTO> listSearchDetails = new ArrayList<BillingTriggerDoneButFailedInFXDTO>();
    BillingTriggerDoneButFailedInFXDTO objReportsDto = null;
    int recordCount = 0;
    Utility utility = new Utility();
    DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    Date tempDate = null;
    Timestamp ts = null;
    try {
        connection = DbConnection.getReportsConnectionObject();
        proc = connection.prepareCall(sqlGetBillingTriggerDoneButFailedInFX);

        if (objDto.getOrderType() != null && !"".equals(objDto.getOrderType())) {
            proc.setString(1, objDto.getOrderType().trim());
        } else {
            proc.setNull(1, java.sql.Types.VARCHAR);
        }

        if (objDto.getFromDate() != null && !"".equals(objDto.getFromDate())) {
            proc.setString(2, objDto.getFromDate().trim());
        } else {
            proc.setNull(2, java.sql.Types.VARCHAR);
        }

        if (objDto.getToDate() != null && !"".equals(objDto.getToDate())) {
            proc.setString(3, objDto.getToDate().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }

        if (objDto.getFromOrderNo() != 0 && !"".equals(objDto.getFromOrderNo())) {
            proc.setInt(4, objDto.getFromOrderNo());
        } else {
            proc.setNull(4, java.sql.Types.BIGINT);
        }

        if (objDto.getToOrderNo() != 0 && !"".equals(objDto.getToOrderNo())) {
            proc.setInt(5, objDto.getToOrderNo());
        } else {
            proc.setNull(5, java.sql.Types.BIGINT);
        }

        if (objDto.getFromAccountNo() != 0 && !"".equals(objDto.getFromAccountNo())) {
            proc.setInt(6, objDto.getFromAccountNo());
        } else {
            proc.setNull(6, java.sql.Types.BIGINT);
        }

        if (objDto.getToAccountNo() != 0 && !"".equals(objDto.getToAccountNo())) {
            proc.setInt(7, objDto.getToAccountNo());
        } else {
            proc.setNull(7, java.sql.Types.BIGINT);
        }

        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(8, pagingSorting.getSortByColumn());// columnName
        proc.setString(9, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(10, pagingSorting.getStartRecordId());// start index
        proc.setInt(11, pagingSorting.getEndRecordId());// end index
        proc.setInt(12, (pagingSorting.isPagingToBeDone() ? 1 : 0));
        proc.setInt(13, objDto.getIsUsage());

        // index
        rs = proc.executeQuery();
        while (rs.next()) {
            objReportsDto = new BillingTriggerDoneButFailedInFXDTO();
            //[270513]Start : Added by Ashutosh for Billing Address
            setBlank();
            replaceSeperator("BILLING_LOCATION", rs.getString("BILLING_ADDRESS"));
            replaceSeperator("PRIMARYLOCATION", rs.getString("PRIMARYLOCATION"));
            replaceSeperator("SECONDARYLOCATION", rs.getString("SECONDARYLOCATION"));
            //[270513]Start
            objReportsDto.setLogicalSINumber(rs.getInt("LOGICAL_SI_NO"));
            objReportsDto.setCustomer_logicalSINumber(rs.getInt("CUSTOMER_LOGICAL_SI_NO"));
            objReportsDto.setServiceName(rs.getString("SERVICENAME"));
            objReportsDto.setServiceDetDescription(rs.getString("SERVICEDETDESCRIPTION"));

            //orderStageDescription
            tempDate = rs.getDate("CONTRACTSTARTDATE");
            if (tempDate != null) {

                objReportsDto.setContractStartDate((Utility.showDate_Report(tempDate)).toUpperCase());

            }
            tempDate = rs.getDate("CONTRACTENDDATE");
            if (tempDate != null) {

                objReportsDto.setContractEndDate(Utility.showDate_Report(tempDate).toUpperCase());

            }
            objReportsDto.setCrmAccountNoString(rs.getString("CRMACCOUNTNO"));
            objReportsDto.setCreditPeriodName(rs.getString("CREDITPERIOD"));
            objReportsDto.setCurrencyName(rs.getString("CURRENCYNAME"));
            objReportsDto.setEntity(rs.getString("ENTITYNAME"));
            objReportsDto.setBillingMode(rs.getString("BILLINGMODE"));
            objReportsDto.setBillingTypeName(rs.getString("BILLING_TYPENAME"));
            objReportsDto.setBillingFormatName(rs.getString("BILLING_FORMATNAME"));
            objReportsDto.setLcompanyname(rs.getString("LCOMPANYNAME"));
            objReportsDto.setTaxation(rs.getString("TAXATIONVALUE"));
            objReportsDto.setPenaltyClause(rs.getString("PENALTYCLAUSE"));
            objReportsDto.setBillingLevel(rs.getString("BILLINGLEVEL"));
            objReportsDto.setBillingLevelNo(rs.getLong("BILLING_LEVEL_NO"));
            objReportsDto.setBillingLevelName(rs.getString("BILLING_LEVELNAME"));
            objReportsDto.setPrimaryLocation(VAR_PRIMARYLOCATION);
            objReportsDto.setSecondaryLocation(VAR_SECONDARYLOCATION);
            objReportsDto.setPonum(rs.getLong("PONUMBER"));
            tempDate = rs.getDate("PODATE");
            if (tempDate != null) {

                objReportsDto.setPoDate((Utility.showDate_Report(tempDate)).toUpperCase());

            }
            objReportsDto.setParty_no(rs.getInt("Party_NO"));
            objReportsDto.setPartyName(rs.getString("PARTYNAME"));
            objReportsDto.setBilling_Trigger_Flag(rs.getString("Billing_Trigger_Flag"));
            objReportsDto.setLOC_Date(rs.getString("Pm_Prov_Date"));
            if (rs.getString("Pm_Prov_Date") != null && !"".equals(rs.getString("Pm_Prov_Date"))) {
                String s1 = rs.getString("Pm_Prov_Date");
                String s3 = s1.substring(0, 7);
                String s4 = s1.substring(9, 11);
                String s5 = s3.concat(s4);
                objReportsDto.setLOC_Date(s5);
            }
            objReportsDto.setLocDate(rs.getString("LOCDATE"));
            if (rs.getString("LOCDATE") != null && !"".equals(rs.getString("LOCDATE"))) {

                Date date = df.parse(objReportsDto.getLocDate());
                objReportsDto.setLocDate((Utility.showDate_Report(date)).toUpperCase());

            }
            objReportsDto.setBillingTriggerDate(rs.getString("BILLINGTRIGGERDATE"));
            if (rs.getString("BILLINGTRIGGERDATE") != null && !"".equals(rs.getString("BILLINGTRIGGERDATE"))) {

                Date date = df.parse(objReportsDto.getBillingTriggerDate());
                objReportsDto.setBillingTriggerDate((Utility.showDate_Report(date)).toUpperCase());

            }
            tempDate = rs.getDate("ORDERDATE");
            if (tempDate != null) {
                objReportsDto.setOrderDate((Utility.showDate_Report(tempDate)).toUpperCase());
            }
            tempDate = rs.getDate("ORDER_APPROVED_DATE");
            if (tempDate != null) {
                objReportsDto.setOrderApproveDate(Utility.showDate_Report(tempDate).toUpperCase());
            }
            ts = rs.getTimestamp("COPC_APPROVED_DATE");//Copc date
            if (ts != null) {
                tempDate = new Date(ts.getTime());
                objReportsDto.setCopcApproveDate(Utility.showDate_Report(tempDate).toUpperCase());
            }
            objReportsDto.setOrderType(rs.getString("ORDERTYPE"));

            //   --Order Type Id
            //   --Service Order Type
            //   ''SERVICE ORDER TYPE DESC'' AS SERVICE_ORDER_TYPE_DESC,
            //     "TST3"."TASK_END_DATE" as "COPC_APPROVED_DATE",      
            //    --TPOSERVICEDETAILS.BILLINGTRIGGERDATE as BILLINGTRIGGER_CREATE_DATE, 
            //    --Cust Logical Si ( Duplicate column)            
            // --Charge Type Id
            objReportsDto.setServiceStage(rs.getString("SERVICE_STAGE"));
            objReportsDto.setAccountManager(rs.getString("ACCOUNTMANAGER"));
            objReportsDto.setProjectManager(rs.getString("PROJECTMANAGER"));
            // --"TPOMASTER"."ORDERDATE" ORDERCREATION DATE
            tempDate = rs.getDate("SERVICE_RFS_DATE");
            if (tempDate != null) {
                objReportsDto.setRfsDate((Utility.showDate_Report(tempDate)).toUpperCase());
            }
            tempDate = rs.getDate("PORECEIVEDATE");
            if (rs.getString("PORECEIVEDATE") != null && !"".equals(rs.getString("PORECEIVEDATE"))) {
                objReportsDto.setPoRecieveDate((Utility.showDate_Report(tempDate)).toUpperCase());
            }

            //--Fx Status Ed       
            objReportsDto.setCustPoDetailNo(rs.getString("CUSTPONUMBER"));
            tempDate = rs.getDate("CUSTPODATE");
            if (tempDate != null) {
                objReportsDto.setCustPoDate((Utility.showDate_Report(tempDate)).toUpperCase());
            }

            objReportsDto.setLOC_No(rs.getString("LOCNO"));
            objReportsDto.setBillingAddress(VAR_BILLING_ADDRESS);
            objReportsDto.setFxSiId(rs.getString("FX_SI_ID"));
            objReportsDto.setCancelBy(rs.getString("CANCEL_BY"));
            //objReportsDto.setCanceldate(rs.getString("CANCEL_DATE"));//CANCEL_DATE
            tempDate = rs.getDate("CANCEL_DATE");
            if (tempDate != null) {
                objReportsDto.setCanceldate((Utility.showDate_Report(tempDate)).toUpperCase());
            }
            objReportsDto.setCancelReason(rs.getString("CANCEL_RESION"));
            objReportsDto.setOpms_Account_Id(rs.getString("Opms_Account_Id"));
            objReportsDto.setRegionName(rs.getString("REGION"));
            objReportsDto.setBandwaidth(rs.getString("BANDWIDTH"));
            objReportsDto.setVerticalDetails(rs.getString("VERTICAL_DETAILS"));
            objReportsDto.setToLocation(rs.getString("FROM_ADDRESS"));
            objReportsDto.setFromLocation(rs.getString("TO_ADDRESS"));
            objReportsDto.setColl_Manager(rs.getString("COLL_MANAGER"));
            objReportsDto.setColl_Manager_Mail(rs.getString("COLL_MANAGER_MAIL"));
            objReportsDto.setColl_Manager_Phone(rs.getString("COLL_MANAGER_PHONE"));
            objReportsDto.setBilling_bandwidth(rs.getString("BILLING_BANDWIDTH"));
            objReportsDto.setOrder_type(rs.getString("DEMO_TYPE"));
            //--CRM ORDER ID
            objReportsDto.setOrderNumber(rs.getInt("ORDERNO"));
            //--Charge Hdr Id
            objReportsDto.setOrderLineNumber(rs.getInt("Order_Line_Id"));
            objReportsDto.setServiceId(rs.getInt("SERVICE_NO"));

            objReportsDto.setTotalPoAmt(rs.getString("TOTALPOAMOUNT"));
            //    --Installment Rate            
            //--Trai Rate
            //--Discount
            objReportsDto.setContractPeriod(rs.getInt("CONTRACTPERIOD"));
            objReportsDto.setCommitmentPeriod(rs.getInt("COMMITMENTPERIOD"));
            objReportsDto.setNoticePeriod(rs.getInt("NOTICEPERIOD"));
            //--Principal Amt
            //   --Intrest Rate
            //   --Period In Month
            objReportsDto.setPoAmount(rs.getString("CUST_TOT_PO_AMT"));
            // --party Id
            //   --Cust Account id
            //  --M6 Product Id
            //  --M6 Order Id
            //  --Ib Order Line Id
            // --Ib Service List Id
            //  --Ib Pk Charges Id
            //  --Fx Sno
            //  --Fx Sno Ed
            // --Cust Tot Po Amt
            // --M6 Order No
            //  --Business Serial No
            //  --Bus Serial
            // --Advance
            if (objDto.getIsUsage() == 1) {
                objReportsDto.setOrderStage(rs.getString("ORDERSTAGE"));
                objReportsDto.setComponentInfoID(rs.getInt("COMPONENTINFOID"));
                objReportsDto.setComponentID(rs.getInt("COMPONENT_ID"));
                objReportsDto.setComponentName(rs.getString("COMPONENT_NAME"));
                objReportsDto.setPackageID(rs.getInt("PACKAGE_ID"));
                objReportsDto.setPackageName(rs.getString("PACKAGE_NAME"));
                objReportsDto.setCreditPeriodName(rs.getString("CREDIT_PERIODNAME"));
                objReportsDto.setServiceOrderType(rs.getString("SERVICE_ORDER_TYPE_DESC"));
                objReportsDto.setM6OrderNo(rs.getInt("M6ORDERNO"));
                objReportsDto.setCancelServiceReason(rs.getString("CANCEL_SERVICE_REASON"));
                //objReportsDto.setCancelBy(rs.getString("CANCELBY"));   
                //objReportsDto.setCanceldate(rs.getString("CANCELDATE"));

                ComponentsDto dto = new ComponentsDto();
                dto.setComponentStatus(rs.getString("COMPONENT_STATUS"));
                dto.setStartLogic(rs.getString("COMPONENT_START_LOGIC"));
                dto.setStartDate(rs.getString("COMPONENT_START_DATE"));
                if (rs.getString("COMPONENT_START_DATE") != null
                        && !"".equals(rs.getString("COMPONENT_START_DATE"))) {

                    Date date = df.parse(dto.getStartDate());
                    dto.setStartDate((Utility.showDate_Report(date)).toUpperCase());

                }
                dto.setEndLogic(rs.getString("COMPONENT_END_LOGIC"));
                dto.setEnd_date(rs.getString("COMPONENT_END_DATE"));
                if (rs.getString("COMPONENT_END_DATE") != null
                        && !"".equals(rs.getString("COMPONENT_END_DATE"))) {

                    Date date = df.parse(dto.getEnd_date());
                    dto.setEnd_date((Utility.showDate_Report(date)).toUpperCase());

                }
                dto.setFxTokenNo(rs.getString("START_COMPONENT_TOKEN_NO"));
                dto.setFxStartStatus(rs.getString("SYSTEM_START_STATUS"));
                dto.setEndTokenNo(rs.getString("LOCAL_END_COMPONENT_TOKEN_NO"));
                dto.setEndFxStatus(rs.getString("FX_END_STATUS"));

                objReportsDto.setStartDateDays(rs.getInt("COMP_START_DAYS"));
                objReportsDto.setStartDateMonth(rs.getInt("COMP_START_MONTHS"));
                objReportsDto.setEndDateDays(rs.getInt("COMP_END_DAYS"));
                objReportsDto.setEndDateMonth(rs.getInt("COMP_END_MONTHS"));
                objReportsDto.setFx_internal_acc_id(rs.getLong("INTERNAL_ID"));
                objReportsDto.setFx_external_acc_id(rs.getString("Child_Account_Number"));
                objReportsDto.setChildAccountFXSataus(rs.getString("Child_Account_FX_Sataus"));
                dto.setComponentInstanceID(rs.getString("COMPONENT_INST_ID"));
                dto.setComponentType(rs.getString("COMPONENT_TYPE"));
                dto.setComponentAmount(rs.getDouble("COMP_AMOUNT"));

                objReportsDto.setComponentDto(dto);
            } else {
                objReportsDto.setOrderStage(rs.getString("STAGE"));
                objReportsDto.setFxStatus(rs.getString("CSTATE_START_DETAILS_FX_STATUS"));//FX_STATUS
                objReportsDto.setFx_St_Chg_Status(rs.getString("CSTATE_FX_CHARGE_START_STATUS"));//Fx_St_Chg_Status
                objReportsDto.setFx_Ed_Chg_Status(rs.getString("CSTATE_FX_CHARGE_END_STATUS"));//Fx_Ed_Chg_Status
                objReportsDto.setTokenNO(rs.getString("CSTATE_START_DETAILS_FX_TOKEN_NO"));//Token_No
                objReportsDto.setChallenno(rs.getString("CHALLEN_NO"));
                objReportsDto.setChallendate(rs.getString("CHALLEN_DATE"));
                if (rs.getString("CHALLEN_DATE") != null && !"".equals(rs.getString("CHALLEN_DATE"))) {
                    Date date = df.parse(objReportsDto.getChallendate());
                    objReportsDto.setChallendate((Utility.showDate_Report(date)).toUpperCase());
                }
                objReportsDto.setFx_external_acc_id(rs.getString("Child_Account_Number"));
                objReportsDto.setChildAccountFXSataus(rs.getString("Child_Account_FX_Sataus"));
                objReportsDto.setWarrantyStartDate(rs.getString("WARRENTY_START_DATE"));
                if (rs.getString("WARRENTY_START_DATE") != null
                        && !"".equals(rs.getString("WARRENTY_START_DATE"))) {
                    Date date = df.parse(objReportsDto.getWarrantyStartDate());
                    objReportsDto.setWarrantyStartDate((Utility.showDate_Report(date)).toUpperCase());
                }
                objReportsDto.setWarrantyEndDate(rs.getString("WARRENTY_END_DATE"));
                if (rs.getString("WARRENTY_END_DATE") != null
                        && !"".equals(rs.getString("WARRENTY_END_DATE"))) {
                    Date date = df.parse(objReportsDto.getWarrantyEndDate());
                    objReportsDto.setWarrantyEndDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setExtSuportEndDate(rs.getString("EXT_SUPPORT_END_DATE"));
                if (rs.getString("EXT_SUPPORT_END_DATE") != null
                        && !"".equals(rs.getString("EXT_SUPPORT_END_DATE"))) {
                    Date date = df.parse(objReportsDto.getExtSuportEndDate());
                    objReportsDto.setExtSuportEndDate((Utility.showDate_Report(date)).toUpperCase());
                }
                objReportsDto.setDispatchAddressName(rs.getString("DISPATCHADDNAME"));
                objReportsDto.setHardwareFlag(rs.getString("HARDWARE_FLAG"));
                objReportsDto.setTokenNoEd(rs.getString("CSTATE_END_DETAILS_FX_TOKEN_NO"));//--Token No Ed
                objReportsDto.setHardwaretypeName(rs.getString("HARDWARETYPENAME"));
                objReportsDto.setFormAvailable(rs.getString("FORM_C_AVAILABLE"));
                objReportsDto.setSaleNature(rs.getString("SALENATURE"));
                objReportsDto.setSaleType(rs.getString("SALETYPE"));
                objReportsDto.setChargeTypeName(rs.getString("CHARGE_TYPE"));
                objReportsDto.setFrequencyName(rs.getString("FREQUENCY"));
                objReportsDto.setChargeName(rs.getString("CHARGE_NAME"));
                if ((rs.getString("CONFIG_ID")) != null && !"".equals(rs.getString("CONFIG_ID"))
                        && (rs.getString("ENTITYID")) != null && !"".equals(rs.getString("ENTITYID"))) {
                    String tBillPeriod = fnGetUsageReportBIllPeriod(rs.getString("CONFIG_ID"),
                            rs.getString("ENTITYID"));
                    objReportsDto.setBillPeriod(tBillPeriod);
                }
                objReportsDto.setDnd_Dispatch_But_Not_Delivered(rs.getString("Dnd_Dispatch_But_Not_Delivered"));
                objReportsDto.setDnd_Dispatch_And_Delivered(rs.getString("Dnd_Dispatch_And_Delivered"));
                objReportsDto.setDnd_Disp_Del_Not_Installed(rs.getString("Ddni_Disp_Del_Not_Installed"));
                objReportsDto.setDnd_Disp_Delivered_Installed(rs.getString("Ddni_Disp_Delivered_Installed"));
                objReportsDto.setStartDateLogic(rs.getString("STARTDATELOGIC"));
                objReportsDto.setEndDateLogic(rs.getString("ENDDATELOGIC"));
                objReportsDto.setStartDate(rs.getString("START_DATE"));
                if (rs.getString("START_DATE") != null && !"".equals(rs.getString("START_DATE"))) {

                    Date date = df.parse(objReportsDto.getStartDate());
                    objReportsDto.setStartDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setEndDate(rs.getString("END_DATE"));
                if (rs.getString("END_DATE") != null && !"".equals(rs.getString("END_DATE"))) {

                    Date date = df.parse(objReportsDto.getEndDate());
                    objReportsDto.setEndDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setChargeAnnotation(rs.getString("ANNOTATION"));
                objReportsDto.setChargeAmount_String(rs.getString("INV_AMT"));
                objReportsDto.setLineItemAmount(rs.getString("LINEITEMAMOUNT"));
                objReportsDto.setCharge_status(rs.getString("CHARGES_STATUS"));
                objReportsDto.setStartDateDays(rs.getInt("START_DATE_DAYS"));
                objReportsDto.setStartDateMonth(rs.getInt("START_DATE_MONTH"));
                objReportsDto.setEndDateDays(rs.getInt("END_DATE_DAYS"));
                objReportsDto.setEndDateMonth(rs.getInt("END_DATE_MONTH"));
                objReportsDto.setAnnualRate(rs.getString("ANNUAL_RATE"));
            }

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
            }
            listSearchDetails.add(objReportsDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        //ex.printStackTrace();
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(connection);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            //e.printStackTrace();
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        }
    }
    return listSearchDetails;
}

From source file:com.ibm.ioes.dao.ReportsDao_Usage.java

public ArrayList<StartChargeNotPushedInFXDTO> viewStartChargeNotPushedInFx(StartChargeNotPushedInFXDTO objDto) {
    //Nagarjuna/*from  ww  w  .  j  a  va 2s  .c o  m*/
    String methodName = "viewStartChargeNotPushedInFx", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end Nagarjuna
    Connection connection = null;
    CallableStatement proc = null;
    ResultSet rs = null;
    ArrayList<StartChargeNotPushedInFXDTO> listSearchDetails = new ArrayList<StartChargeNotPushedInFXDTO>();
    StartChargeNotPushedInFXDTO objReportsDto = null;
    int recordCount = 0;
    Utility utility = new Utility();
    DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    Date tempDate = null;
    Timestamp ts = null;
    try {
        connection = DbConnection.getReportsConnectionObject();
        proc = connection.prepareCall(sqlGetStartChargeNotPushedInFx);

        if (objDto.getOrderType() != null && !"".equals(objDto.getOrderType())) {
            proc.setString(1, objDto.getOrderType().trim());
        } else {
            proc.setNull(1, java.sql.Types.VARCHAR);
        }

        if (objDto.getFromDate() != null && !"".equals(objDto.getFromDate())) {
            proc.setString(2, objDto.getFromDate().trim());
        } else {
            proc.setNull(2, java.sql.Types.VARCHAR);
        }

        if (objDto.getToDate() != null && !"".equals(objDto.getToDate())) {
            proc.setString(3, objDto.getToDate().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }

        if (objDto.getFromOrderNo() != 0 && !"".equals(objDto.getFromOrderNo())) {
            proc.setInt(4, objDto.getFromOrderNo());
        } else {
            proc.setNull(4, java.sql.Types.BIGINT);
        }

        if (objDto.getToOrderNo() != 0 && !"".equals(objDto.getToOrderNo())) {
            proc.setInt(5, objDto.getToOrderNo());
        } else {
            proc.setNull(5, java.sql.Types.BIGINT);
        }

        if (objDto.getVerticalDetails() != null && !"".equals(objDto.getVerticalDetails())) {
            proc.setString(6, objDto.getVerticalDetails().trim());
        } else {
            proc.setNull(6, java.sql.Types.VARCHAR);
        }

        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(7, pagingSorting.getSortByColumn());// columnName
        proc.setString(8, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(9, pagingSorting.getStartRecordId());// start index
        proc.setInt(10, pagingSorting.getEndRecordId());// end index
        proc.setInt(11, (pagingSorting.isPagingToBeDone() ? 1 : 0));
        // index
        proc.setInt(12, objDto.getIsUsage());
        rs = proc.executeQuery();
        while (rs.next()) {
            objReportsDto = new StartChargeNotPushedInFXDTO();
            objReportsDto.setLogicalSINumber(rs.getInt("LOGICAL_SI_NO"));
            objReportsDto.setCustomer_logicalSINumber(rs.getInt("CUSTOMER_LOGICAL_SI_NO"));
            objReportsDto.setServiceName(rs.getString("SERVICENAME"));
            objReportsDto.setServiceDetDescription(rs.getString("SERVICEDETDESCRIPTION"));

            //objReportsDto.setContractStartDate(rs.getString("CONTRACTSTARTDATE"));
            tempDate = rs.getDate("CONTRACTSTARTDATE");
            objReportsDto.setContractStartDate(rs.getString("CONTRACTSTARTDATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setContractStartDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            //objReportsDto.setContractEndDate(rs.getString("CONTRACTENDDATE"));
            tempDate = rs.getDate("CONTRACTENDDATE");
            objReportsDto.setContractEndDate(rs.getString("CONTRACTENDDATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setContractEndDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            objReportsDto.setCrmAccountNoString(rs.getString("CRMACCOUNTNO"));
            objReportsDto.setCreditPeriodName(rs.getString("CREDITPERIOD"));
            objReportsDto.setCurrencyName(rs.getString("CURRENCYNAME"));
            objReportsDto.setEntity(rs.getString("ENTITYNAME"));
            objReportsDto.setBillingMode(rs.getString("BILLINGMODE"));
            objReportsDto.setBillingTypeName(rs.getString("BILLING_TYPENAME"));
            objReportsDto.setBillingFormatName(rs.getString("BILLING_FORMATNAME"));
            objReportsDto.setLcompanyname(rs.getString("LCOMPANYNAME"));
            objReportsDto.setTaxation(rs.getString("TAXATIONVALUE"));
            objReportsDto.setPenaltyClause(rs.getString("PENALTYCLAUSE"));
            objReportsDto.setBillingLevel(rs.getString("BILLINGLEVEL"));
            objReportsDto.setBillingLevelNo(rs.getLong("BILLING_LEVEL_NO"));
            objReportsDto.setBillingLevelName(rs.getString("BILLING_LEVELNAME"));
            //objReportsDto.setPrimaryLocation(rs.getString("PRIMARYLOCATION"));
            //objReportsDto.setSecondaryLocation(rs.getString("SECONDARYLOCATION"));
            setBlank();
            replaceSeperator("PRIMARYLOCATION", rs.getString("PRIMARYLOCATION"));
            objReportsDto.setPrimaryLocation(VAR_PRIMARYLOCATION);
            replaceSeperator("SECONDARYLOCATION", rs.getString("SECONDARYLOCATION"));
            objReportsDto.setSecondaryLocation(VAR_SECONDARYLOCATION);
            objReportsDto.setPonum(rs.getLong("PONUMBER"));
            /*objReportsDto.setPoDate(rs.getString("PODATE"));
            if (rs.getString("PODATE") != null && !"".equals(rs.getString("PODATE")))
            {
                       
               Date date=df.parse(objReportsDto.getPoDate());
               objReportsDto.setPoDate((Utility.showDate_Report(date)).toUpperCase());
                       
            }*/
            tempDate = rs.getDate("PODATE");
            objReportsDto.setPoDate(rs.getString("PODATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setPoDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            objReportsDto.setParty_no(rs.getInt("Party_NO"));
            objReportsDto.setPartyName(rs.getString("PARTYNAME"));
            objReportsDto.setBilling_Trigger_Flag(rs.getString("Billing_Trigger_Flag"));
            objReportsDto.setLOC_Date(rs.getString("Pm_Prov_Date"));
            if (rs.getString("Pm_Prov_Date") != null && !"".equals(rs.getString("Pm_Prov_Date"))) {
                String s1 = rs.getString("Pm_Prov_Date");
                String s3 = s1.substring(0, 7);
                String s4 = s1.substring(9, 11);
                String s5 = s3.concat(s4);
                objReportsDto.setPmApproveDate(s5);

            }
            objReportsDto.setLocDate(rs.getString("LOCDATE"));
            if (rs.getString("LOCDATE") != null && !"".equals(rs.getString("LOCDATE"))) {

                Date date = df.parse(objReportsDto.getLocDate());
                objReportsDto.setLocDate((Utility.showDate_Report(date)).toUpperCase());

            }
            objReportsDto.setBillingTriggerDate(rs.getString("BILLINGTRIGGERDATE"));
            if (rs.getString("BILLINGTRIGGERDATE") != null && !"".equals(rs.getString("BILLINGTRIGGERDATE"))) {

                Date date = df.parse(objReportsDto.getBillingTriggerDate());
                objReportsDto.setBillingTriggerDate((Utility.showDate_Report(date)).toUpperCase());

            }
            objReportsDto.setChallenno(rs.getString("CHALLEN_NO"));
            objReportsDto.setChallendate(rs.getString("CHALLEN_DATE"));
            if (rs.getString("CHALLEN_DATE") != null && !"".equals(rs.getString("CHALLEN_DATE"))) {
                //Date date=df.parse(objReportsDto.getChallendate());
                objReportsDto.setChallendate(rs.getString("CHALLEN_DATE"));
            }
            objReportsDto.setFx_external_acc_id(rs.getString("Child_Account_Number"));
            objReportsDto.setChildAccountFXSataus(rs.getString("Child_Account_FX_Sataus"));

            /*objReportsDto.setOrderDate(rs.getString("ORDERDATE"));  
            if (rs.getString("ORDERDATE") != null && !"".equals(rs.getString("ORDERDATE")))
            {
                              
               Date date=df.parse(objReportsDto.getOrderDate());
               objReportsDto.setOrderDate((Utility.showDate_Report(date)).toUpperCase());
                       
                       
            }*/
            tempDate = rs.getDate("ORDERDATE");
            objReportsDto.setOrderDate(rs.getString("ORDERDATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setOrderDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            objReportsDto.setOrderApproveDate(rs.getString("ORDER_APPROVED_DATE"));//Copc date
            tempDate = rs.getDate("ORDER_APPROVED_DATE");
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setOrderApproveDate((utility.showDate_Report(tempDate)).toUpperCase());

            }
            objReportsDto.setCopcApproveDate(rs.getString("COPC_APPROVED_DATE"));
            ts = rs.getTimestamp("COPC_APPROVED_DATE");
            if (ts != null) {
                tempDate = new Date(ts.getTime());
                objReportsDto.setCopcApproveDate((utility.showDate_Report(tempDate)).toUpperCase());

            }
            objReportsDto.setOrderType(rs.getString("ORDERTYPE"));
            //   --Order Type Id
            //   --Service Order Type  
            //   ''SERVICE ORDER TYPE DESC'' AS SERVICE_ORDER_TYPE_DESC,
            //     "TST3"."TASK_END_DATE" as "COPC_APPROVED_DATE",      
            //    --TPOSERVICEDETAILS.BILLINGTRIGGERDATE as BILLINGTRIGGER_CREATE_DATE, 
            //    --Cust Logical Si ( Duplicate column)

            // --Charge Type Id
            objReportsDto.setServiceStage(rs.getString("SERVICE_STAGE"));
            objReportsDto.setAccountManager(rs.getString("ACCOUNTMANAGER"));
            objReportsDto.setProjectManager(rs.getString("PROJECTMANAGER"));
            // --"TPOMASTER"."ORDERDATE" ORDERCREATION DATE
            /*objReportsDto.setRfsDate(rs.getString("SERVICE_RFS_DATE"));  
            if (rs.getString("SERVICE_RFS_DATE") != null && !"".equals(rs.getString("SERVICE_RFS_DATE")))
            {
               Date date=df.parse(objReportsDto.getRfsDate());
               objReportsDto.setRfsDate((Utility.showDate_Report(date)).toUpperCase());
            }*/
            tempDate = rs.getDate("SERVICE_RFS_DATE");
            objReportsDto.setRfsDate(rs.getString("SERVICE_RFS_DATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setRfsDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            /*objReportsDto.setPoRecieveDate(rs.getString("PORECEIVEDATE"));   
            if (rs.getString("PORECEIVEDATE") != null && !"".equals(rs.getString("PORECEIVEDATE")))
            {
                       
               Date date=df.parse(objReportsDto.getPoRecieveDate());
               objReportsDto.setPoRecieveDate((Utility.showDate_Report(date)).toUpperCase());
                       
            }*/
            tempDate = rs.getDate("PORECEIVEDATE");
            objReportsDto.setPoRecieveDate(rs.getString("PORECEIVEDATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setPoRecieveDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            //--Fx Status Ed       
            objReportsDto.setCustPoDetailNo(rs.getString("CUSTPONUMBER"));
            /*objReportsDto.setCustPoDate(rs.getString("CUSTPODATE"));  
            if (rs.getString("CUSTPODATE") != null && !"".equals(rs.getString("CUSTPODATE")))
            {
                       
               Date date=df.parse(objReportsDto.getCustPoDate());
               objReportsDto.setCustPoDate((Utility.showDate_Report(date)).toUpperCase());
                       
            }*/
            tempDate = rs.getDate("CUSTPODATE");
            objReportsDto.setCustPoDate(rs.getString("CUSTPODATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objReportsDto.setCustPoDate((utility.showDate_Report(tempDate)).toUpperCase());
            }

            objReportsDto.setLOC_No(rs.getString("LOCNO"));
            //objReportsDto.setBillingAddress(rs.getString("BILLING_ADDRESS"));
            replaceSeperator("BILLING_LOCATION", rs.getString("BILLING_ADDRESS"));
            objReportsDto.setBillingAddress(VAR_BILLING_ADDRESS);
            objReportsDto.setFxSiId(rs.getString("FX_SI_ID"));
            objReportsDto.setCancelBy(rs.getString("CANCEL_BY"));
            objReportsDto.setCanceldate(rs.getString("CANCEL_DATE"));
            objReportsDto.setCancelReason(rs.getString("CANCEL_RESION"));
            objReportsDto.setOpms_Account_Id(rs.getString("Opms_Account_Id"));
            objReportsDto.setRegionName(rs.getString("REGION"));
            objReportsDto.setBandwaidth(rs.getString("BANDWIDTH"));
            objReportsDto.setVerticalDetails(rs.getString("VERTICAL_DETAILS"));
            objReportsDto.setToLocation(rs.getString("FROM_ADDRESS"));
            objReportsDto.setFromLocation(rs.getString("TO_ADDRESS"));
            objReportsDto.setColl_Manager(rs.getString("COLL_MANAGER"));
            objReportsDto.setColl_Manager_Mail(rs.getString("COLL_MANAGER_MAIL"));
            objReportsDto.setColl_Manager_Phone(rs.getString("COLL_MANAGER_PHONE"));
            objReportsDto.setBilling_bandwidth(rs.getString("BILLING_BANDWIDTH"));
            objReportsDto.setOrder_type(rs.getString("DEMO_TYPE"));
            objReportsDto.setTotalPoAmt(rs.getString("TOTALPOAMOUNT"));
            //--CRM ORDER ID
            objReportsDto.setOrderNumber(rs.getInt("ORDERNO"));

            //--Charge Hdr Id
            objReportsDto.setOrderLineNumber(rs.getInt("Order_Line_Id"));
            objReportsDto.setServiceId(rs.getInt("SERVICE_NO"));
            //    --Installment Rate            
            //--Trai Rate
            //--Discount
            objReportsDto.setContractPeriod(rs.getInt("CONTRACTPERIOD"));
            objReportsDto.setCommitmentPeriod(rs.getInt("COMMITMENTPERIOD"));
            objReportsDto.setNoticePeriod(rs.getInt("NOTICEPERIOD"));
            //--Principal Amt
            //   --Intrest Rate
            //   --Period In Month
            objReportsDto.setPoAmount(rs.getString("CUST_TOT_PO_AMT"));
            // --party Id
            //   --Cust Account id
            //  --M6 Product Id
            //  --M6 Order Id
            //  --Ib Order Line Id
            // --Ib Service List Id
            //  --Ib Pk Charges Id
            //  --Fx Sno
            //  --Fx Sno Ed
            // --Cust Tot Po Amt
            // --M6 Order No
            //  --Business Serial No
            //  --Bus Serial
            // --Advance
            // Meenakshi : Changes for Usage
            if (objDto.getIsUsage() == 1) {

                objReportsDto.setComponentInfoID(rs.getInt("COMPONENTINFOID"));
                objReportsDto.setComponentID(rs.getInt("COMPONENT_ID"));
                objReportsDto.setComponentName(rs.getString("COMPONENT_NAME"));
                objReportsDto.setPackageID(rs.getInt("PACKAGE_ID"));
                objReportsDto.setPackageName(rs.getString("PACKAGE_NAME"));
                objReportsDto.setCreditPeriodName(rs.getString("CREDIT_PERIODNAME"));
                objReportsDto.setServiceOrderType(rs.getString("SERVICE_ORDER_TYPE_DESC"));
                objReportsDto.setM6OrderNo(rs.getInt("M6ORDERNO"));
                objReportsDto.setCancelServiceReason(rs.getString("CANCEL_SERVICE_REASON"));
                objReportsDto.setCancelBy(rs.getString("CANCELBY"));
                objReportsDto.setCanceldate(rs.getString("CANCELDATE"));
                objReportsDto.setOrderStage(rs.getString("ORDERSTAGE"));

                ComponentsDto dto = new ComponentsDto();
                dto.setComponentStatus(rs.getString("COMPONENT_STATUS"));
                dto.setStartLogic(rs.getString("COMPONENT_START_LOGIC"));
                dto.setStartDate(rs.getString("SYSTEM_START_DATE"));
                if (rs.getString("SYSTEM_START_DATE") != null
                        && !"".equals(rs.getString("SYSTEM_START_DATE"))) {

                    Date date = df.parse(dto.getStartDate());
                    dto.setStartDate((Utility.showDate_Report(date)).toUpperCase());

                }
                dto.setEndLogic(rs.getString("COMPONENT_END_LOGIC"));
                dto.setEnd_date(rs.getString("SYSTEM_END_DATE"));
                if (rs.getString("SYSTEM_END_DATE") != null && !"".equals(rs.getString("SYSTEM_END_DATE"))) {

                    Date date = df.parse(dto.getEnd_date());
                    dto.setEnd_date((Utility.showDate_Report(date)).toUpperCase());

                }
                dto.setFxTokenNo(rs.getString("START_COMPONENT_TOKEN_NO"));
                dto.setFxStartStatus(rs.getString("SYSTEM_START_STATUS"));
                dto.setEndFxStatus(rs.getString("SYSTEM_END_STATUS"));
                dto.setEndTokenNo(rs.getString("END_COMPONENT_TOKEN_NO"));
                //dto.setComponentFXStatus(rs.getString("FX_STATUS"));
                objReportsDto.setStartDateDays(rs.getInt("COMP_START_DAYS"));
                objReportsDto.setStartDateMonth(rs.getInt("COMP_START_MONTHS"));
                objReportsDto.setEndDateDays(rs.getInt("COMP_END_DAYS"));
                objReportsDto.setEndDateMonth(rs.getInt("COMP_END_MONTHS"));
                objReportsDto.setSourcePartyID(rs.getLong("PARTY_ID"));
                objReportsDto.setAccountID(rs.getInt("CUSTACCOUNTID"));
                objReportsDto.setFx_internal_acc_id(rs.getLong("INTERNAL_ID"));
                dto.setComponentInstanceID(rs.getString("COMPONENT_INST_ID"));
                dto.setComponentType(rs.getString("COMPONENT_TYPE"));
                dto.setComponentAmount(rs.getDouble("COMP_AMOUNT"));

                ///dto.setEndTokenNo(rs.getString("")); //END_COMPONENT_TOKEN_NO  
                objReportsDto.setComponentDto(dto);
            } else {
                objReportsDto.setOrderStage(rs.getString("STAGE"));
                objReportsDto.setTokenNoEd(rs.getString("CSTATE_END_DETAILS_FX_TOKEN_NO"));//--Token No Ed
                objReportsDto.setHardwareFlag(rs.getString("HARDWARE_FLAG"));
                objReportsDto.setWarrantyStartDate(rs.getString("WARRENTY_START_DATE"));
                if (rs.getString("WARRENTY_START_DATE") != null
                        && !"".equals(rs.getString("WARRENTY_START_DATE"))) {

                    Date date = df.parse(objReportsDto.getWarrantyStartDate());
                    objReportsDto.setWarrantyStartDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setWarrantyEndDate(rs.getString("WARRENTY_END_DATE"));
                if (rs.getString("WARRENTY_END_DATE") != null
                        && !"".equals(rs.getString("WARRENTY_END_DATE"))) {

                    Date date = df.parse(objReportsDto.getWarrantyEndDate());
                    objReportsDto.setWarrantyEndDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setExtSuportEndDate(rs.getString("EXT_SUPPORT_END_DATE"));
                if (rs.getString("EXT_SUPPORT_END_DATE") != null
                        && !"".equals(rs.getString("EXT_SUPPORT_END_DATE"))) {

                    Date date = df.parse(objReportsDto.getExtSuportEndDate());
                    objReportsDto.setExtSuportEndDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setFxStatus(rs.getString("CSTATE_START_DETAILS_FX_STATUS"));//FX_STATUS            
                objReportsDto.setTokenNO(rs.getString("CSTATE_START_DETAILS_FX_TOKEN_NO"));//Token_No
                objReportsDto.setHardwaretypeName(rs.getString("HARDWARETYPENAME"));
                objReportsDto.setFormAvailable(rs.getString("FORM_C_AVAILABLE"));
                objReportsDto.setSaleNature(rs.getString("SALENATURE"));
                objReportsDto.setSaleType(rs.getString("SALETYPE"));
                objReportsDto.setDispatchAddressName(rs.getString("DISPATCHADDNAME"));
                objReportsDto.setChargeTypeName(rs.getString("CHARGE_TYPE"));
                objReportsDto.setFrequencyName(rs.getString("FREQUENCY"));
                objReportsDto.setChargeName(rs.getString("CHARGE_NAME"));
                objReportsDto.setBillPeriod(rs.getString("BILL_PERIOD"));
                objReportsDto.setDnd_Dispatch_But_Not_Delivered(rs.getString("Dnd_Dispatch_But_Not_Delivered"));
                objReportsDto.setDnd_Dispatch_And_Delivered(rs.getString("Dnd_Dispatch_And_Delivered"));
                objReportsDto.setDnd_Disp_Del_Not_Installed(rs.getString("Ddni_Disp_Del_Not_Installed"));
                objReportsDto.setDnd_Disp_Delivered_Installed(rs.getString("Ddni_Disp_Delivered_Installed"));
                objReportsDto.setStartDateLogic(rs.getString("STARTDATELOGIC"));
                objReportsDto.setEndDateLogic(rs.getString("ENDDATELOGIC"));
                objReportsDto.setStartDate(rs.getString("START_DATE"));
                if (rs.getString("START_DATE") != null && !"".equals(rs.getString("START_DATE"))) {

                    Date date = df.parse(objReportsDto.getStartDate());
                    objReportsDto.setStartDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setEndDate(rs.getString("END_DATE"));
                if (rs.getString("END_DATE") != null && !"".equals(rs.getString("END_DATE"))) {

                    Date date = df.parse(objReportsDto.getEndDate());
                    objReportsDto.setEndDate((Utility.showDate_Report(date)).toUpperCase());

                }
                objReportsDto.setChargeAnnotation(rs.getString("ANNOTATION"));
                objReportsDto.setFx_St_Chg_Status(rs.getString("CSTATE_FX_CHARGE_START_STATUS"));//Fx_St_Chg_Status
                objReportsDto.setFx_Ed_Chg_Status(rs.getString("CSTATE_FX_CHARGE_END_STATUS"));//Fx_Ed_Chg_Status
                objReportsDto.setCharge_status(rs.getString("CHARGES_STATUS"));
                objReportsDto.setChargeAmount_String(rs.getString("INV_AMT"));
                objReportsDto.setLineItemAmount(rs.getString("LINEITEMAMOUNT"));
                objReportsDto.setStartDateDays(rs.getInt("START_DATE_DAYS"));
                objReportsDto.setStartDateMonth(rs.getInt("START_DATE_MONTH"));
                objReportsDto.setEndDateDays(rs.getInt("END_DATE_DAYS"));
                objReportsDto.setEndDateMonth(rs.getInt("END_DATE_MONTH"));
                objReportsDto.setAnnual_rate(rs.getDouble("ANNUAL_RATE"));
            }

            /// End

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
            }
            listSearchDetails.add(objReportsDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        //ex.printStackTrace();
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(connection);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            //e.printStackTrace();
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        }
    }
    return listSearchDetails;
}

From source file:com.ibm.ioes.dao.ReportsDao_Usage.java

public ArrayList<RateRenewalReportDTO> viewRateRenewalReport(RateRenewalReportDTO objDto) throws Exception {

    //   Nagarjuna
    String methodName = "viewRateRenewalReport", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end Nagarjuna
    ArrayList<RateRenewalReportDTO> objUserList = new ArrayList<RateRenewalReportDTO>();
    Connection conn = null;//www.ja  v  a2  s.  c om
    CallableStatement proc = null;
    ResultSet rs = null;
    int recordCount = 0;
    RateRenewalReportDTO objRDto;
    Utility utility = new Utility();
    DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    Date tempDate = null;
    try {

        conn = DbConnection.getReportsConnectionObject();

        proc = conn.prepareCall(sqlRateRenewalReportforUsage);

        /*   if (objDto.getOrderType() != null
                 && !"".equals(objDto.getOrderType())) {
              proc.setString(1, objDto.getOrderType().trim());
           } else {
              proc.setNull(1, java.sql.Types.VARCHAR);
           }*/
        if (objDto.getFromDate() != null && !"".equals(objDto.getFromDate())) {
            SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr = formatter.parse(objDto.getFromDate());
            String formattedDate = formatter.format(dateStr);
            Date date1 = formatter.parse(formattedDate);
            formatter = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate = formatter.format(date1);
            proc.setString(1, formattedDate);
            //proc.setString(2, objDto.getFromDate().trim());
        } else {
            proc.setNull(1, java.sql.Types.VARCHAR);
        }
        if (objDto.getToDate() != null && !"".equals(objDto.getToDate())) {
            SimpleDateFormat formatter1 = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr1 = formatter1.parse(objDto.getToDate());
            String formattedDate1 = formatter1.format(dateStr1);
            Date date2 = formatter1.parse(formattedDate1);
            formatter1 = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate1 = formatter1.format(date2);
            proc.setString(2, formattedDate1);
        } else {
            proc.setNull(2, java.sql.Types.VARCHAR);
        }
        /*if (objDto.getDemo() != null && !"".equals(objDto.getDemo())) {
           proc.setString(4, objDto.getDemo().trim());
        } else {
           proc.setNull(4, java.sql.Types.VARCHAR);
        }
        */
        if (objDto.getFromAccountNo() != 0 && objDto.getToAccountNo() != 0) {
            proc.setLong(3, objDto.getFromAccountNo());
            proc.setLong(4, objDto.getToAccountNo());
        } else {
            proc.setNull(3, java.sql.Types.BIGINT);
            proc.setNull(4, java.sql.Types.BIGINT);
        }

        if (objDto.getFromOrderNo() != 0 && objDto.getToOrderNo() != 0) {
            proc.setLong(5, objDto.getFromOrderNo());
            proc.setLong(6, objDto.getToOrderNo());
        } else {
            proc.setNull(5, java.sql.Types.BIGINT);
            proc.setNull(6, java.sql.Types.BIGINT);
        }

        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(7, pagingSorting.getSortByColumn());// columnName
        proc.setString(8, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(9, pagingSorting.getStartRecordId());// start index
        proc.setInt(10, pagingSorting.getEndRecordId());// end index
        proc.setInt(11, (pagingSorting.isPagingToBeDone() ? 1 : 0));// end
        // index
        proc.setInt(12, (objDto.getIsUsage()));// end
        if (objDto.getFromCopcApprovedDate() != null && !"".equals(objDto.getFromCopcApprovedDate())) {
            SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr = formatter.parse(objDto.getFromCopcApprovedDate());
            String formattedDate = formatter.format(dateStr);
            Date date1 = formatter.parse(formattedDate);
            formatter = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate = formatter.format(date1);
            proc.setString(13, formattedDate);
        } else {
            proc.setNull(13, java.sql.Types.VARCHAR);
        }
        if (objDto.getToCopcApprovedDate() != null && !"".equals(objDto.getToCopcApprovedDate())) {
            SimpleDateFormat formatter1 = new SimpleDateFormat("dd/MM/yyyy");
            Date dateStr1 = formatter1.parse(objDto.getToCopcApprovedDate());
            String formattedDate1 = formatter1.format(dateStr1);
            Date date2 = formatter1.parse(formattedDate1);
            formatter1 = new SimpleDateFormat("MM-dd-yyyy");
            formattedDate1 = formatter1.format(date2);
            proc.setString(14, formattedDate1);
        } else {
            proc.setNull(14, java.sql.Types.VARCHAR);
        }

        rs = proc.executeQuery();
        int countFlag = 0;
        while (rs.next() != false) {
            countFlag++;

            objRDto = new RateRenewalReportDTO();
            objRDto.setPartyNo(rs.getInt("PARTY_NO"));
            objRDto.setPartyName(rs.getString("PARTYNAME"));
            objRDto.setCrmACcountNO(rs.getString("CRMACCOUNTNO"));
            objRDto.setAccountManager(rs.getString("ACCOUNTMANAGER"));
            objRDto.setCus_segment(rs.getString("CUST_SEGMENT_CODE"));
            objRDto.setServiceSegment(rs.getString("SERVICESEGMENT"));//Added in View
            objRDto.setVerticalDetails(rs.getString("VERTICAL_DETAILS"));
            objRDto.setRegionName(rs.getString("REGION"));
            //objRDto.setServiceDetDescription(rs.getString("SERVICEDETDESCRIPTION"));PARENT_NAME
            objRDto.setBilling_bandwidth(rs.getString("BILLING_BANDWIDTH"));
            objRDto.setBilling_uom(rs.getString("BILLING_BANDWIDTH_UOM"));
            //objRDto.setChangeTypeName(rs.getString("NAME_SUBTYPE"));SERVICE_ORDER_TYPE_DESC
            objRDto.setOrderType(rs.getString("ORDERTYPE"));
            //objRDto.setCompanyName(rs.getString("COMPANYNAME"));ENTITYNAME

            //objRDto.setCurrencyCode(rs.getString("CURNAME"));CURRENCYNAME
            /*objRDto.setPoDate(rs.getString("PODATE"));
            if (rs.getString("PODATE") != null && !"".equals(rs.getString("PODATE")))
            {                        
               Date date=df.parse(objRDto.getPoDate());
               objRDto.setPoDate((utility.showDate_Report(date)).toUpperCase());
               //objDto.setPoDate((utility.showDate_Report(new Date(rs.getTimestamp("PODATE").getTime()))).toUpperCase());                     
               objRDto.setPoDate(utility.showDate_Report(df.parse(rs.getString("PODATE"))).toUpperCase());
            }*/

            tempDate = rs.getDate("PODATE");
            objRDto.setPoDate(rs.getString("PODATE"));
            if (tempDate != null && !"".equals(tempDate)) {
                objRDto.setPoDate((utility.showDate_Report(tempDate)).toUpperCase());
            }
            objRDto.setCustPoDetailNo(rs.getString("CUSTPONUMBER"));

            //objRDto.setFromLocation(rs.getString("PRIMARYLOCATION"));
            //objRDto.setToLocation(rs.getString("SECONDARYLOCATION"));
            setBlank();
            replaceSeperator("PRIMARYLOCATION", rs.getString("PRIMARYLOCATION"));
            objRDto.setFromLocation(VAR_PRIMARYLOCATION);
            //objReportsDto.setSeclocation(rs.getString("SECONDARYLOCATION"));
            replaceSeperator("SECONDARYLOCATION", rs.getString("SECONDARYLOCATION"));
            objRDto.setToLocation(VAR_SECONDARYLOCATION);
            objRDto.setDistance(rs.getString("DISTANCE"));
            objRDto.setLineItemDescription(rs.getString("SERVICEDETDESCRIPTION"));//Changed Column Name :AKS
            objRDto.setLOC_Date(rs.getString("LOCDATE"));
            if (rs.getString("LOCDATE") != null && !"".equals(rs.getString("LOCDATE"))) {

                Date date = df.parse(objRDto.getLOC_Date());
                objRDto.setLOC_Date((utility.showDate_Report(date)).toUpperCase());
            }

            objRDto.setLogicalCircuitNumber(rs.getString("CKTID"));

            objRDto.setTaxationName(rs.getString("TAXATIONVALUE"));
            objRDto.setLcompanyname(rs.getString("LCOMPANYNAME"));
            objRDto.setOrder_type(rs.getString("DEMO_TYPE"));
            objRDto.setServiceStage(rs.getString("SERVICE_STAGE"));
            objRDto.setNewOrderRemark(rs.getString("NEWORDER_REMARKS"));
            objRDto.setBilling_trigger_date(rs.getString("BILLINGTRIGGERDATE"));
            if (rs.getString("BILLINGTRIGGERDATE") != null && !"".equals(rs.getString("BILLINGTRIGGERDATE"))) {
                Date date = df.parse(objRDto.getBilling_trigger_date());
                objRDto.setBilling_trigger_date((utility.showDate_Report(date)).toUpperCase());
            }
            //objRDto.setBillingTriggerFlag(rs.getString("BILLINGTRIGGERFLAG"));Billing_Trigger_Flag
            //objRDto.setZoneName(rs.getString("ZONE"));ZONENNAME
            objRDto.setSalesCoordinator(rs.getString("SALESCOORDINATOR"));//Column Added in View :AKS
            //objRDto.setPoAmounts(rs.getDouble("POAMOUNT"));ORDERTOTAL
            objRDto.setContractPeriod(rs.getInt("CONTRACTPERIOD"));
            objRDto.setItemQuantity(1);//Need to Ask Ravneet : AKS
            //objRDto.setServiceId(rs.getInt("SERVICEID"));SERVICE_NO 
            objRDto.setM6OrderNo(rs.getInt("M6ORDERNO"));
            objRDto.setCustSINo(rs.getString("CUSTOMER_LOGICAL_SI_NO"));
            objRDto.setM6cktid(rs.getString("CKTID"));
            //objRDto.setServiceProductID(rs.getInt("SERVICEPRODUCTID"));Order_Line_Id
            objRDto.setOrderNo(rs.getString("ORDERNO"));
            if (objDto.getIsUsage() == 0) {
                objRDto.setCreatedDate(rs.getString("CREATEDDATE"));
                if (rs.getString("CREATEDDATE") != null && !"".equals(rs.getString("CREATEDDATE"))) {

                    objRDto.setCreatedDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("CREATEDDATE").getTime())))
                                    .toUpperCase());
                }
                objRDto.setChargeName(rs.getString("CHARGE_NAME"));
                objRDto.setChargeTypeName(rs.getString("CHARGENAME"));
                objRDto.setPaymentTerm(rs.getString("PAYMENTTERM"));
                objRDto.setLinename(rs.getString("SERVICEDETDESCRIPTION"));
                objRDto.setStartDate(rs.getString("START_DATE"));
                if (rs.getString("START_DATE") != null && !"".equals(rs.getString("START_DATE"))) {

                    Date date = df.parse(objRDto.getStartDate());
                    objRDto.setStartDate((utility.showDate_Report(date)).toUpperCase());

                }
                objRDto.setEndDate(rs.getString("END_DATE"));
                if (rs.getString("END_DATE") != null && !"".equals(rs.getString("END_DATE"))) {

                    Date date = df.parse(objRDto.getEndDate());
                    objRDto.setEndDate((utility.showDate_Report(date)).toUpperCase());

                }
                objRDto.setEndHWDateLogic(rs.getString("ENDDATELOGIC"));
                objRDto.setCharge_status(rs.getString("CHARGES_STATUS"));
                objRDto.setStartDaysLogic(rs.getString("CHARGESTARTDAYSLOGIC"));
                objRDto.setCurrencyCode(rs.getString("CURNAME"));
                objRDto.setStartMonthsLogic(rs.getString("CHARGESTARTMONTHSLOGIC"));
                objRDto.setOrderTotal(rs.getDouble("POAMOUNT"));
                objRDto.setChargeAmount(rs.getDouble("CHARGEAMOUNT"));
                objRDto.setOldLineitemAmount(rs.getString("CHARGEAMOUNT"));
                objRDto.setChargePeriod(rs.getInt("CHARGEPERIOD"));
                objRDto.setAnnual_rate(rs.getDouble("ANNUAL_RATE"));
                objRDto.setTxtStartDays(rs.getInt("START_DATE_DAYS"));
                objRDto.setTxtStartMonth(rs.getInt("START_DATE_MONTH"));
                objRDto.setServiceDetDescription(rs.getString("SERVICEDETDESCRIPTION"));
                objRDto.setChangeTypeName(rs.getString("NAME_SUBTYPE"));
                objRDto.setCompanyName(rs.getString("COMPANYNAME"));
                objRDto.setCopcApproveDate(rs.getString("COPC_APPROVAL_DATE"));
                if (rs.getString("COPC_APPROVAL_DATE") != null
                        && !"".equals(rs.getString("COPC_APPROVAL_DATE"))) {
                    objRDto.setCopcApproveDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("COPC_APPROVAL_DATE").getTime())))
                                    .toUpperCase());
                }
                objRDto.setStageName(rs.getString("ORDER_STAGE"));
                objRDto.setRemarks(rs.getString("REMARKS"));
                objRDto.setProductName(rs.getString("SERVICESTAGE"));
                objRDto.setSubProductName(rs.getString("SERVICESUBTYPENAME"));
                objRDto.setZoneName(rs.getString("ZONE"));
                objRDto.setPoAmounts(rs.getDouble("POAMOUNT"));
                objRDto.setServiceId(rs.getInt("SERVICEID"));
                objRDto.setServiceProductID(rs.getInt("SERVICEPRODUCTID"));
                objRDto.setBillingTriggerFlag(rs.getString("BILLINGTRIGGERFLAG"));
                objRDto.setOldOrderNo(rs.getInt("OLDORDERNO"));
            }
            if (objDto.getIsUsage() == 1) {
                objRDto.setLogicalSINumber(rs.getInt("LOGICAL_SI_NO"));
                objRDto.setOrderTotal(rs.getDouble("ORDERTOTAL"));
                objRDto.setFx_external_acc_id(rs.getString("Child_Account_Number"));//FX_ACCOUNT_EXTERNAL_ID
                objRDto.setFxInternalId(rs.getInt("INTERNAL_ID"));
                objRDto.setChild_account_creation_status(rs.getString("Child_Account_FX_Sataus"));//CHILD_ACCOUNT_FX_STATUS
                objRDto.setPackageID(rs.getInt("PACKAGE_ID"));
                objRDto.setPackageName(rs.getString("PACKAGE_NAME"));
                objRDto.setComponentID(rs.getInt("COMPONENT_ID"));
                objRDto.setComponentName(rs.getString("COMPONENT_NAME"));
                objRDto.setComponentInfoID(rs.getInt("COMPONENTINFOID"));
                ComponentsDto dto = new ComponentsDto();
                dto.setComponentType(rs.getString("COMPONENT_TYPE"));
                dto.setComponentAmount(rs.getDouble("COMP_AMOUNT"));//RC_NRC_COMP_AMOUNT
                dto.setComponentStatus(rs.getString("COMPONENT_STATUS"));
                dto.setStartLogic(rs.getString("COMPONENT_START_LOGIC"));
                dto.setStartDateDays(rs.getInt("COMP_START_DAYS"));//START_DAYS
                dto.setStartDateMonth(rs.getInt("COMP_START_MONTHS"));//START_MONTHS
                dto.setEndLogic(rs.getString("COMPONENT_END_LOGIC"));
                dto.setEndDateDays(rs.getInt("COMP_END_DAYS"));//END_DAYS
                dto.setEndDateMonth(rs.getInt("COMP_END_MONTHS"));//END_MONTHS
                objRDto.setServiceDetDescription(rs.getString("PARENT_NAME"));
                objRDto.setChangeTypeName(rs.getString("SERVICE_ORDER_TYPE_DESC"));
                objRDto.setCompanyName(rs.getString("ENTITYNAME"));
                objRDto.setCopcApproveDate(rs.getString("COPC_APPROVED_DATE"));
                if (rs.getString("COPC_APPROVED_DATE") != null
                        && !"".equals(rs.getString("COPC_APPROVED_DATE"))) {
                    objRDto.setCopcApproveDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("COPC_APPROVED_DATE").getTime())))
                                    .toUpperCase());
                }
                objRDto.setStageName(rs.getString("ORDERSTAGE"));
                objRDto.setRemarks(rs.getString("DISCONNECTION_REMARKS"));
                objRDto.setProductName(rs.getString("SERVICENAME"));
                objRDto.setCurrencyCode(rs.getString("CURRENCYNAME"));
                objRDto.setSubProductName(rs.getString("SUBPRODUCTNAME"));
                objRDto.setZoneName(rs.getString("ZONENNAME"));
                objRDto.setPoAmounts(rs.getDouble("TOTALPOAMOUNT"));
                objRDto.setServiceId(rs.getInt("SERVICE_NO"));
                objRDto.setServiceProductID(rs.getInt("Order_Line_Id"));
                objRDto.setBillingTriggerFlag(rs.getString("Billing_Trigger_Flag"));
                objRDto.setOldOrderNo(rs.getInt("Pre_Crm_orderNo"));
                dto.setStartDate(rs.getString("SYSTEM_START_DATE"));
                if (rs.getString("SYSTEM_START_DATE") != null
                        && !"".equals(rs.getString("SYSTEM_START_DATE"))) {
                    Date date = df.parse(dto.getStartDate());
                    dto.setStartDate((utility.showDate_Report(date)).toUpperCase());
                }

                dto.setEnd_date(rs.getString("COMPONENT_END_DATE"));
                if (rs.getString("COMPONENT_END_DATE") != null
                        && !"".equals(rs.getString("COMPONENT_END_DATE"))) {
                    Date date = df.parse(dto.getEnd_date());
                    dto.setEnd_date((utility.showDate_Report(date)).toUpperCase());
                }
                objRDto.setComponentDto(dto);
                //NANCY START
                objRDto.setIsDifferential(rs.getString("IS_DIFFERENTIAL"));
                objRDto.setCopcApproverName(rs.getString("COPC_APPROVER_NAME"));
                objRDto.setEffectiveDate(rs.getString("EFFECTIVEDATE"));
                if (rs.getString("EFFECTIVEDATE") != null && !"".equals(rs.getString("EFFECTIVEDATE"))) {
                    objRDto.setEffectiveDate(
                            (utility.showDate_Report(new Date(rs.getTimestamp("EFFECTIVEDATE").getTime())))
                                    .toUpperCase());
                }
                objRDto.setBillingTriggerCreateDate(rs.getString("BILLING_TRIGGER_CREATEDATE"));
                if (rs.getString("BILLING_TRIGGER_CREATEDATE") != null
                        && !"".equals(rs.getString("BILLING_TRIGGER_CREATEDATE"))) {
                    objRDto.setBillingTriggerCreateDate((utility
                            .showDate_Report(new Date(rs.getTimestamp("BILLING_TRIGGER_CREATEDATE").getTime())))
                                    .toUpperCase());
                }
                objRDto.setIsTriggerRequired(rs.getString("IsTriggerRequired"));
                objRDto.setLineTriggered(rs.getString("LineTriggered"));
                objRDto.setTriggerProcess(rs.getString("TriggerProcess"));
                objRDto.setTriggerDoneBy(rs.getString("TriggerDoneBy"));
                objRDto.setAutomaticTriggerError(rs.getString("AutomaticTriggerError"));
                //NANCY END
            }

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
                //recordCount = countFlag;
            }
            objUserList.add(objRDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        //ex.printStackTrace();
        throw new Exception("SQL Exception : " + ex.getMessage(), ex);
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(conn);

        } catch (Exception e) {
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
            //e.printStackTrace();
            throw new Exception("Exception : " + e.getMessage(), e);
        }
    }

    return objUserList;
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFProfileTable.java

public void createFSSFProfile(CFFswAuthorization Authorization, CFFswFSSFProfileBuff Buff) {
    final String S_ProcName = "createFSSFProfile";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  ww  w  . j  a va 2s. c  o  m
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        long FSSFProfileId = Buff.getRequiredFSSFProfileId();
        long FSSofiaId = Buff.getRequiredFSSofiaId();
        String Name = Buff.getRequiredName();
        short Debug = Buff.getRequiredDebug();
        boolean SipTrace = Buff.getRequiredSipTrace();
        short SipPort = Buff.getRequiredSipPort();
        String Dialplan = Buff.getRequiredDialplan();
        String Context = Buff.getRequiredContext();
        int DTMFDuration = Buff.getRequiredDTMFDuration();
        String CodecPrefs = Buff.getRequiredCodecPrefs();
        String HoldMusic = Buff.getRequiredHoldMusic();
        String RTPTimerName = Buff.getRequiredRTPTimerName();
        boolean Enable100Rel = Buff.getRequiredEnable100Rel();
        boolean ManagePresence = Buff.getRequiredManagePresence();
        String DbName = Buff.getOptionalDbName();
        String PresenceHosts = Buff.getRequiredPresenceHosts();
        String ForceRegisterDomain = Buff.getRequiredForceRegisterDomain();
        String ForceRegisterDbDomain = Buff.getOptionalForceRegisterDbDomain();
        boolean AggressiveNATDetection = Buff.getRequiredAggressiveNATDetection();
        String InboundCodecNegotiation = Buff.getRequiredInboundCodecNegotiation();
        short NonCETTL = Buff.getRequiredNonCETTL();
        boolean AuthCalls = Buff.getRequiredAuthCalls();
        int RtpTimeoutSec = Buff.getRequiredRtpTimeoutSec();
        String RtpIP = Buff.getRequiredRtpIP();
        String SipIP = Buff.getRequiredSipIP();
        String ExtRtpIP = Buff.getRequiredExtRtpIP();
        String ExtSipIP = Buff.getRequiredExtSipIP();
        boolean Enable3PCC = Buff.getRequiredEnable3PCC();
        String TlsBindParams = Buff.getRequiredTlsBindParams();
        short TlsSipPort = Buff.getRequiredTlsSipPort();
        String TlsCertDir = Buff.getRequiredTlsCertDir();
        String TlsVersion = Buff.getRequiredTlsVersion();
        boolean RtpAutoflushDuringBridge = Buff.getRequiredRtpAutoflushDuringBridge();
        boolean RtpRewriteTimestamp = Buff.getRequiredRtpRewriteTimestamp();
        boolean PassRFC2833 = Buff.getRequiredPassRFC2833();
        String OdbcDSN = Buff.getOptionalOdbcDSN();
        boolean InboundBypassMedia = Buff.getRequiredInboundBypassMedia();
        boolean InboundProxyMedia = Buff.getRequiredInboundProxyMedia();
        boolean InboundLateNegotiation = Buff.getRequiredInboundLateNegotiation();
        boolean AcceptBlindReg = Buff.getRequiredAcceptBlindReg();
        boolean AcceptBlindAuth = Buff.getRequiredAcceptBlindAuth();
        boolean SuppressCNG = Buff.getRequiredSuppressCNG();
        boolean DisableTranscoding = Buff.getRequiredDisableTranscoding();
        boolean DisableTransfer = Buff.getRequiredDisableTransfer();
        boolean NDLBBrokenAuthHash = Buff.getRequiredNDLBBrokenAuthHash();
        boolean NDLBReceivedInNATRegContact = Buff.getRequiredNDLBReceivedInNATRegContact();
        boolean InboundRegForceMatchingUsername = Buff.getRequiredInboundRegForceMatchingUsername();
        boolean AuthAllPackets = Buff.getRequiredAuthAllPackets();
        String Vad = Buff.getRequiredVad();
        String Alias = Buff.getRequiredAlias();
        int ForceSubscriptionExpires = Buff.getRequiredForceSubscriptionExpires();
        boolean DisableRegister = Buff.getRequiredDisableRegister();
        boolean NDLBForceReport = Buff.getRequiredNDLBForceReport();
        String ChallengeRealm = Buff.getRequiredChallengeRealm();
        boolean DisableRtpAutoAdjust = Buff.getRequiredDisableRtpAutoAdjust();
        boolean InboundUseCallIdAsUUID = Buff.getRequiredInboundUseCallIdAsUUID();
        boolean OutboundUseUUIDAsCallId = Buff.getRequiredOutboundUseUUIDAsCallId();
        boolean RtpAutofixTiming = Buff.getRequiredRtpAutofixTiming();
        String AutoRtpBugs = Buff.getRequiredAutoRtpBugs();
        boolean DisableSrv = Buff.getRequiredDisableSrv();
        boolean DisableNAPtr = Buff.getRequiredDisableNAPtr();
        int TimerT1 = Buff.getRequiredTimerT1();
        int TimerT1X64 = Buff.getRequiredTimerT1X64();
        int TimerT2 = Buff.getRequiredTimerT2();
        int TimerT4 = Buff.getRequiredTimerT4();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_fssfprofile( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtCreateByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtCreateByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtCreateByPKey.setString(argIdx++, "FSPF");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setLong(argIdx++, FSSFProfileId);
        stmtCreateByPKey.setLong(argIdx++, FSSofiaId);
        stmtCreateByPKey.setString(argIdx++, Name);
        stmtCreateByPKey.setShort(argIdx++, Debug);
        if (SipTrace) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setShort(argIdx++, SipPort);
        stmtCreateByPKey.setString(argIdx++, Dialplan);
        stmtCreateByPKey.setString(argIdx++, Context);
        stmtCreateByPKey.setInt(argIdx++, DTMFDuration);
        stmtCreateByPKey.setString(argIdx++, CodecPrefs);
        stmtCreateByPKey.setString(argIdx++, HoldMusic);
        stmtCreateByPKey.setString(argIdx++, RTPTimerName);
        if (Enable100Rel) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (ManagePresence) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DbName != null) {
            stmtCreateByPKey.setString(argIdx++, DbName);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtCreateByPKey.setString(argIdx++, PresenceHosts);
        stmtCreateByPKey.setString(argIdx++, ForceRegisterDomain);
        if (ForceRegisterDbDomain != null) {
            stmtCreateByPKey.setString(argIdx++, ForceRegisterDbDomain);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (AggressiveNATDetection) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, InboundCodecNegotiation);
        stmtCreateByPKey.setShort(argIdx++, NonCETTL);
        if (AuthCalls) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setInt(argIdx++, RtpTimeoutSec);
        stmtCreateByPKey.setString(argIdx++, RtpIP);
        stmtCreateByPKey.setString(argIdx++, SipIP);
        stmtCreateByPKey.setString(argIdx++, ExtRtpIP);
        stmtCreateByPKey.setString(argIdx++, ExtSipIP);
        if (Enable3PCC) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, TlsBindParams);
        stmtCreateByPKey.setShort(argIdx++, TlsSipPort);
        stmtCreateByPKey.setString(argIdx++, TlsCertDir);
        stmtCreateByPKey.setString(argIdx++, TlsVersion);
        if (RtpAutoflushDuringBridge) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (RtpRewriteTimestamp) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (PassRFC2833) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (OdbcDSN != null) {
            stmtCreateByPKey.setString(argIdx++, OdbcDSN);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (InboundBypassMedia) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundProxyMedia) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundLateNegotiation) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (AcceptBlindReg) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (AcceptBlindAuth) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (SuppressCNG) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DisableTranscoding) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DisableTransfer) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (NDLBBrokenAuthHash) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (NDLBReceivedInNATRegContact) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundRegForceMatchingUsername) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (AuthAllPackets) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, Vad);
        stmtCreateByPKey.setString(argIdx++, Alias);
        stmtCreateByPKey.setInt(argIdx++, ForceSubscriptionExpires);
        if (DisableRegister) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (NDLBForceReport) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, ChallengeRealm);
        if (DisableRtpAutoAdjust) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundUseCallIdAsUUID) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (OutboundUseUUIDAsCallId) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (RtpAutofixTiming) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, AutoRtpBugs);
        if (DisableSrv) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DisableNAPtr) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setInt(argIdx++, TimerT1);
        stmtCreateByPKey.setInt(argIdx++, TimerT1X64);
        stmtCreateByPKey.setInt(argIdx++, TimerT2);
        stmtCreateByPKey.setInt(argIdx++, TimerT4);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_fssfprofile() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFFswFSSFProfileBuff createdBuff = unpackFSSFProfileResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredTenantId(createdBuff.getRequiredTenantId());
                Buff.setRequiredFSSFProfileId(createdBuff.getRequiredFSSFProfileId());
                Buff.setRequiredFSSofiaId(createdBuff.getRequiredFSSofiaId());
                Buff.setRequiredName(createdBuff.getRequiredName());
                Buff.setRequiredDebug(createdBuff.getRequiredDebug());
                Buff.setRequiredSipTrace(createdBuff.getRequiredSipTrace());
                Buff.setRequiredSipPort(createdBuff.getRequiredSipPort());
                Buff.setRequiredDialplan(createdBuff.getRequiredDialplan());
                Buff.setRequiredContext(createdBuff.getRequiredContext());
                Buff.setRequiredDTMFDuration(createdBuff.getRequiredDTMFDuration());
                Buff.setRequiredCodecPrefs(createdBuff.getRequiredCodecPrefs());
                Buff.setRequiredHoldMusic(createdBuff.getRequiredHoldMusic());
                Buff.setRequiredRTPTimerName(createdBuff.getRequiredRTPTimerName());
                Buff.setRequiredEnable100Rel(createdBuff.getRequiredEnable100Rel());
                Buff.setRequiredManagePresence(createdBuff.getRequiredManagePresence());
                Buff.setOptionalDbName(createdBuff.getOptionalDbName());
                Buff.setRequiredPresenceHosts(createdBuff.getRequiredPresenceHosts());
                Buff.setRequiredForceRegisterDomain(createdBuff.getRequiredForceRegisterDomain());
                Buff.setOptionalForceRegisterDbDomain(createdBuff.getOptionalForceRegisterDbDomain());
                Buff.setRequiredAggressiveNATDetection(createdBuff.getRequiredAggressiveNATDetection());
                Buff.setRequiredInboundCodecNegotiation(createdBuff.getRequiredInboundCodecNegotiation());
                Buff.setRequiredNonCETTL(createdBuff.getRequiredNonCETTL());
                Buff.setRequiredAuthCalls(createdBuff.getRequiredAuthCalls());
                Buff.setRequiredRtpTimeoutSec(createdBuff.getRequiredRtpTimeoutSec());
                Buff.setRequiredRtpIP(createdBuff.getRequiredRtpIP());
                Buff.setRequiredSipIP(createdBuff.getRequiredSipIP());
                Buff.setRequiredExtRtpIP(createdBuff.getRequiredExtRtpIP());
                Buff.setRequiredExtSipIP(createdBuff.getRequiredExtSipIP());
                Buff.setRequiredEnable3PCC(createdBuff.getRequiredEnable3PCC());
                Buff.setRequiredTlsBindParams(createdBuff.getRequiredTlsBindParams());
                Buff.setRequiredTlsSipPort(createdBuff.getRequiredTlsSipPort());
                Buff.setRequiredTlsCertDir(createdBuff.getRequiredTlsCertDir());
                Buff.setRequiredTlsVersion(createdBuff.getRequiredTlsVersion());
                Buff.setRequiredRtpAutoflushDuringBridge(createdBuff.getRequiredRtpAutoflushDuringBridge());
                Buff.setRequiredRtpRewriteTimestamp(createdBuff.getRequiredRtpRewriteTimestamp());
                Buff.setRequiredPassRFC2833(createdBuff.getRequiredPassRFC2833());
                Buff.setOptionalOdbcDSN(createdBuff.getOptionalOdbcDSN());
                Buff.setRequiredInboundBypassMedia(createdBuff.getRequiredInboundBypassMedia());
                Buff.setRequiredInboundProxyMedia(createdBuff.getRequiredInboundProxyMedia());
                Buff.setRequiredInboundLateNegotiation(createdBuff.getRequiredInboundLateNegotiation());
                Buff.setRequiredAcceptBlindReg(createdBuff.getRequiredAcceptBlindReg());
                Buff.setRequiredAcceptBlindAuth(createdBuff.getRequiredAcceptBlindAuth());
                Buff.setRequiredSuppressCNG(createdBuff.getRequiredSuppressCNG());
                Buff.setRequiredDisableTranscoding(createdBuff.getRequiredDisableTranscoding());
                Buff.setRequiredDisableTransfer(createdBuff.getRequiredDisableTransfer());
                Buff.setRequiredNDLBBrokenAuthHash(createdBuff.getRequiredNDLBBrokenAuthHash());
                Buff.setRequiredNDLBReceivedInNATRegContact(
                        createdBuff.getRequiredNDLBReceivedInNATRegContact());
                Buff.setRequiredInboundRegForceMatchingUsername(
                        createdBuff.getRequiredInboundRegForceMatchingUsername());
                Buff.setRequiredAuthAllPackets(createdBuff.getRequiredAuthAllPackets());
                Buff.setRequiredVad(createdBuff.getRequiredVad());
                Buff.setRequiredAlias(createdBuff.getRequiredAlias());
                Buff.setRequiredForceSubscriptionExpires(createdBuff.getRequiredForceSubscriptionExpires());
                Buff.setRequiredDisableRegister(createdBuff.getRequiredDisableRegister());
                Buff.setRequiredNDLBForceReport(createdBuff.getRequiredNDLBForceReport());
                Buff.setRequiredChallengeRealm(createdBuff.getRequiredChallengeRealm());
                Buff.setRequiredDisableRtpAutoAdjust(createdBuff.getRequiredDisableRtpAutoAdjust());
                Buff.setRequiredInboundUseCallIdAsUUID(createdBuff.getRequiredInboundUseCallIdAsUUID());
                Buff.setRequiredOutboundUseUUIDAsCallId(createdBuff.getRequiredOutboundUseUUIDAsCallId());
                Buff.setRequiredRtpAutofixTiming(createdBuff.getRequiredRtpAutofixTiming());
                Buff.setRequiredAutoRtpBugs(createdBuff.getRequiredAutoRtpBugs());
                Buff.setRequiredDisableSrv(createdBuff.getRequiredDisableSrv());
                Buff.setRequiredDisableNAPtr(createdBuff.getRequiredDisableNAPtr());
                Buff.setRequiredTimerT1(createdBuff.getRequiredTimerT1());
                Buff.setRequiredTimerT1X64(createdBuff.getRequiredTimerT1X64());
                Buff.setRequiredTimerT2(createdBuff.getRequiredTimerT2());
                Buff.setRequiredTimerT4(createdBuff.getRequiredTimerT4());
                Buff.setRequiredRevision(createdBuff.getRequiredRevision());
                Buff.setCreatedByUserId(createdBuff.getCreatedByUserId());
                Buff.setCreatedAt(createdBuff.getCreatedAt());
                Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId());
                Buff.setUpdatedAt(createdBuff.getUpdatedAt());
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Expected a single-record response, " + resultSet.getRow() + " rows selected");
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_fssfprofile() did not return a valid result set");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtCreateByPKey != null) {
            try {
                stmtCreateByPKey.close();
            } catch (SQLException e) {
            }
            stmtCreateByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFProfileTable.java

public void updateFSSFProfile(CFFswAuthorization Authorization, CFFswFSSFProfileBuff Buff) {
    final String S_ProcName = "updateFSSFProfile";
    ResultSet resultSet = null;/*from   www  .  j a v a 2  s.c  o  m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFFswFSSFProfileBuff> buffList = new LinkedList<CFFswFSSFProfileBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long FSSFProfileId = Buff.getRequiredFSSFProfileId();
        long FSSofiaId = Buff.getRequiredFSSofiaId();
        String Name = Buff.getRequiredName();
        short Debug = Buff.getRequiredDebug();
        boolean SipTrace = Buff.getRequiredSipTrace();
        short SipPort = Buff.getRequiredSipPort();
        String Dialplan = Buff.getRequiredDialplan();
        String Context = Buff.getRequiredContext();
        int DTMFDuration = Buff.getRequiredDTMFDuration();
        String CodecPrefs = Buff.getRequiredCodecPrefs();
        String HoldMusic = Buff.getRequiredHoldMusic();
        String RTPTimerName = Buff.getRequiredRTPTimerName();
        boolean Enable100Rel = Buff.getRequiredEnable100Rel();
        boolean ManagePresence = Buff.getRequiredManagePresence();
        String DbName = Buff.getOptionalDbName();
        String PresenceHosts = Buff.getRequiredPresenceHosts();
        String ForceRegisterDomain = Buff.getRequiredForceRegisterDomain();
        String ForceRegisterDbDomain = Buff.getOptionalForceRegisterDbDomain();
        boolean AggressiveNATDetection = Buff.getRequiredAggressiveNATDetection();
        String InboundCodecNegotiation = Buff.getRequiredInboundCodecNegotiation();
        short NonCETTL = Buff.getRequiredNonCETTL();
        boolean AuthCalls = Buff.getRequiredAuthCalls();
        int RtpTimeoutSec = Buff.getRequiredRtpTimeoutSec();
        String RtpIP = Buff.getRequiredRtpIP();
        String SipIP = Buff.getRequiredSipIP();
        String ExtRtpIP = Buff.getRequiredExtRtpIP();
        String ExtSipIP = Buff.getRequiredExtSipIP();
        boolean Enable3PCC = Buff.getRequiredEnable3PCC();
        String TlsBindParams = Buff.getRequiredTlsBindParams();
        short TlsSipPort = Buff.getRequiredTlsSipPort();
        String TlsCertDir = Buff.getRequiredTlsCertDir();
        String TlsVersion = Buff.getRequiredTlsVersion();
        boolean RtpAutoflushDuringBridge = Buff.getRequiredRtpAutoflushDuringBridge();
        boolean RtpRewriteTimestamp = Buff.getRequiredRtpRewriteTimestamp();
        boolean PassRFC2833 = Buff.getRequiredPassRFC2833();
        String OdbcDSN = Buff.getOptionalOdbcDSN();
        boolean InboundBypassMedia = Buff.getRequiredInboundBypassMedia();
        boolean InboundProxyMedia = Buff.getRequiredInboundProxyMedia();
        boolean InboundLateNegotiation = Buff.getRequiredInboundLateNegotiation();
        boolean AcceptBlindReg = Buff.getRequiredAcceptBlindReg();
        boolean AcceptBlindAuth = Buff.getRequiredAcceptBlindAuth();
        boolean SuppressCNG = Buff.getRequiredSuppressCNG();
        boolean DisableTranscoding = Buff.getRequiredDisableTranscoding();
        boolean DisableTransfer = Buff.getRequiredDisableTransfer();
        boolean NDLBBrokenAuthHash = Buff.getRequiredNDLBBrokenAuthHash();
        boolean NDLBReceivedInNATRegContact = Buff.getRequiredNDLBReceivedInNATRegContact();
        boolean InboundRegForceMatchingUsername = Buff.getRequiredInboundRegForceMatchingUsername();
        boolean AuthAllPackets = Buff.getRequiredAuthAllPackets();
        String Vad = Buff.getRequiredVad();
        String Alias = Buff.getRequiredAlias();
        int ForceSubscriptionExpires = Buff.getRequiredForceSubscriptionExpires();
        boolean DisableRegister = Buff.getRequiredDisableRegister();
        boolean NDLBForceReport = Buff.getRequiredNDLBForceReport();
        String ChallengeRealm = Buff.getRequiredChallengeRealm();
        boolean DisableRtpAutoAdjust = Buff.getRequiredDisableRtpAutoAdjust();
        boolean InboundUseCallIdAsUUID = Buff.getRequiredInboundUseCallIdAsUUID();
        boolean OutboundUseUUIDAsCallId = Buff.getRequiredOutboundUseUUIDAsCallId();
        boolean RtpAutofixTiming = Buff.getRequiredRtpAutofixTiming();
        String AutoRtpBugs = Buff.getRequiredAutoRtpBugs();
        boolean DisableSrv = Buff.getRequiredDisableSrv();
        boolean DisableNAPtr = Buff.getRequiredDisableNAPtr();
        int TimerT1 = Buff.getRequiredTimerT1();
        int TimerT1X64 = Buff.getRequiredTimerT1X64();
        int TimerT2 = Buff.getRequiredTimerT2();
        int TimerT4 = Buff.getRequiredTimerT4();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".upd_fssfprofile( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "? ); end;");
        int argIdx = 1;
        stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtUpdateByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtUpdateByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtUpdateByPKey.setString(argIdx++, "FSPF");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, FSSFProfileId);
        stmtUpdateByPKey.setLong(argIdx++, FSSofiaId);
        stmtUpdateByPKey.setString(argIdx++, Name);
        stmtUpdateByPKey.setShort(argIdx++, Debug);
        if (SipTrace) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setShort(argIdx++, SipPort);
        stmtUpdateByPKey.setString(argIdx++, Dialplan);
        stmtUpdateByPKey.setString(argIdx++, Context);
        stmtUpdateByPKey.setInt(argIdx++, DTMFDuration);
        stmtUpdateByPKey.setString(argIdx++, CodecPrefs);
        stmtUpdateByPKey.setString(argIdx++, HoldMusic);
        stmtUpdateByPKey.setString(argIdx++, RTPTimerName);
        if (Enable100Rel) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (ManagePresence) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (DbName != null) {
            stmtUpdateByPKey.setString(argIdx++, DbName);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setString(argIdx++, PresenceHosts);
        stmtUpdateByPKey.setString(argIdx++, ForceRegisterDomain);
        if (ForceRegisterDbDomain != null) {
            stmtUpdateByPKey.setString(argIdx++, ForceRegisterDbDomain);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (AggressiveNATDetection) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setString(argIdx++, InboundCodecNegotiation);
        stmtUpdateByPKey.setShort(argIdx++, NonCETTL);
        if (AuthCalls) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setInt(argIdx++, RtpTimeoutSec);
        stmtUpdateByPKey.setString(argIdx++, RtpIP);
        stmtUpdateByPKey.setString(argIdx++, SipIP);
        stmtUpdateByPKey.setString(argIdx++, ExtRtpIP);
        stmtUpdateByPKey.setString(argIdx++, ExtSipIP);
        if (Enable3PCC) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setString(argIdx++, TlsBindParams);
        stmtUpdateByPKey.setShort(argIdx++, TlsSipPort);
        stmtUpdateByPKey.setString(argIdx++, TlsCertDir);
        stmtUpdateByPKey.setString(argIdx++, TlsVersion);
        if (RtpAutoflushDuringBridge) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (RtpRewriteTimestamp) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (PassRFC2833) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (OdbcDSN != null) {
            stmtUpdateByPKey.setString(argIdx++, OdbcDSN);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (InboundBypassMedia) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (InboundProxyMedia) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (InboundLateNegotiation) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (AcceptBlindReg) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (AcceptBlindAuth) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (SuppressCNG) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (DisableTranscoding) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (DisableTransfer) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (NDLBBrokenAuthHash) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (NDLBReceivedInNATRegContact) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (InboundRegForceMatchingUsername) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (AuthAllPackets) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setString(argIdx++, Vad);
        stmtUpdateByPKey.setString(argIdx++, Alias);
        stmtUpdateByPKey.setInt(argIdx++, ForceSubscriptionExpires);
        if (DisableRegister) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (NDLBForceReport) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setString(argIdx++, ChallengeRealm);
        if (DisableRtpAutoAdjust) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (InboundUseCallIdAsUUID) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (OutboundUseUUIDAsCallId) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (RtpAutofixTiming) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setString(argIdx++, AutoRtpBugs);
        if (DisableSrv) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        if (DisableNAPtr) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setInt(argIdx++, TimerT1);
        stmtUpdateByPKey.setInt(argIdx++, TimerT1X64);
        stmtUpdateByPKey.setInt(argIdx++, TimerT2);
        stmtUpdateByPKey.setInt(argIdx++, TimerT4);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFFswFSSFProfileBuff updatedBuff = unpackFSSFProfileResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredFSSofiaId(updatedBuff.getRequiredFSSofiaId());
                    Buff.setRequiredName(updatedBuff.getRequiredName());
                    Buff.setRequiredDebug(updatedBuff.getRequiredDebug());
                    Buff.setRequiredSipTrace(updatedBuff.getRequiredSipTrace());
                    Buff.setRequiredSipPort(updatedBuff.getRequiredSipPort());
                    Buff.setRequiredDialplan(updatedBuff.getRequiredDialplan());
                    Buff.setRequiredContext(updatedBuff.getRequiredContext());
                    Buff.setRequiredDTMFDuration(updatedBuff.getRequiredDTMFDuration());
                    Buff.setRequiredCodecPrefs(updatedBuff.getRequiredCodecPrefs());
                    Buff.setRequiredHoldMusic(updatedBuff.getRequiredHoldMusic());
                    Buff.setRequiredRTPTimerName(updatedBuff.getRequiredRTPTimerName());
                    Buff.setRequiredEnable100Rel(updatedBuff.getRequiredEnable100Rel());
                    Buff.setRequiredManagePresence(updatedBuff.getRequiredManagePresence());
                    Buff.setOptionalDbName(updatedBuff.getOptionalDbName());
                    Buff.setRequiredPresenceHosts(updatedBuff.getRequiredPresenceHosts());
                    Buff.setRequiredForceRegisterDomain(updatedBuff.getRequiredForceRegisterDomain());
                    Buff.setOptionalForceRegisterDbDomain(updatedBuff.getOptionalForceRegisterDbDomain());
                    Buff.setRequiredAggressiveNATDetection(updatedBuff.getRequiredAggressiveNATDetection());
                    Buff.setRequiredInboundCodecNegotiation(updatedBuff.getRequiredInboundCodecNegotiation());
                    Buff.setRequiredNonCETTL(updatedBuff.getRequiredNonCETTL());
                    Buff.setRequiredAuthCalls(updatedBuff.getRequiredAuthCalls());
                    Buff.setRequiredRtpTimeoutSec(updatedBuff.getRequiredRtpTimeoutSec());
                    Buff.setRequiredRtpIP(updatedBuff.getRequiredRtpIP());
                    Buff.setRequiredSipIP(updatedBuff.getRequiredSipIP());
                    Buff.setRequiredExtRtpIP(updatedBuff.getRequiredExtRtpIP());
                    Buff.setRequiredExtSipIP(updatedBuff.getRequiredExtSipIP());
                    Buff.setRequiredEnable3PCC(updatedBuff.getRequiredEnable3PCC());
                    Buff.setRequiredTlsBindParams(updatedBuff.getRequiredTlsBindParams());
                    Buff.setRequiredTlsSipPort(updatedBuff.getRequiredTlsSipPort());
                    Buff.setRequiredTlsCertDir(updatedBuff.getRequiredTlsCertDir());
                    Buff.setRequiredTlsVersion(updatedBuff.getRequiredTlsVersion());
                    Buff.setRequiredRtpAutoflushDuringBridge(updatedBuff.getRequiredRtpAutoflushDuringBridge());
                    Buff.setRequiredRtpRewriteTimestamp(updatedBuff.getRequiredRtpRewriteTimestamp());
                    Buff.setRequiredPassRFC2833(updatedBuff.getRequiredPassRFC2833());
                    Buff.setOptionalOdbcDSN(updatedBuff.getOptionalOdbcDSN());
                    Buff.setRequiredInboundBypassMedia(updatedBuff.getRequiredInboundBypassMedia());
                    Buff.setRequiredInboundProxyMedia(updatedBuff.getRequiredInboundProxyMedia());
                    Buff.setRequiredInboundLateNegotiation(updatedBuff.getRequiredInboundLateNegotiation());
                    Buff.setRequiredAcceptBlindReg(updatedBuff.getRequiredAcceptBlindReg());
                    Buff.setRequiredAcceptBlindAuth(updatedBuff.getRequiredAcceptBlindAuth());
                    Buff.setRequiredSuppressCNG(updatedBuff.getRequiredSuppressCNG());
                    Buff.setRequiredDisableTranscoding(updatedBuff.getRequiredDisableTranscoding());
                    Buff.setRequiredDisableTransfer(updatedBuff.getRequiredDisableTransfer());
                    Buff.setRequiredNDLBBrokenAuthHash(updatedBuff.getRequiredNDLBBrokenAuthHash());
                    Buff.setRequiredNDLBReceivedInNATRegContact(
                            updatedBuff.getRequiredNDLBReceivedInNATRegContact());
                    Buff.setRequiredInboundRegForceMatchingUsername(
                            updatedBuff.getRequiredInboundRegForceMatchingUsername());
                    Buff.setRequiredAuthAllPackets(updatedBuff.getRequiredAuthAllPackets());
                    Buff.setRequiredVad(updatedBuff.getRequiredVad());
                    Buff.setRequiredAlias(updatedBuff.getRequiredAlias());
                    Buff.setRequiredForceSubscriptionExpires(updatedBuff.getRequiredForceSubscriptionExpires());
                    Buff.setRequiredDisableRegister(updatedBuff.getRequiredDisableRegister());
                    Buff.setRequiredNDLBForceReport(updatedBuff.getRequiredNDLBForceReport());
                    Buff.setRequiredChallengeRealm(updatedBuff.getRequiredChallengeRealm());
                    Buff.setRequiredDisableRtpAutoAdjust(updatedBuff.getRequiredDisableRtpAutoAdjust());
                    Buff.setRequiredInboundUseCallIdAsUUID(updatedBuff.getRequiredInboundUseCallIdAsUUID());
                    Buff.setRequiredOutboundUseUUIDAsCallId(updatedBuff.getRequiredOutboundUseUUIDAsCallId());
                    Buff.setRequiredRtpAutofixTiming(updatedBuff.getRequiredRtpAutofixTiming());
                    Buff.setRequiredAutoRtpBugs(updatedBuff.getRequiredAutoRtpBugs());
                    Buff.setRequiredDisableSrv(updatedBuff.getRequiredDisableSrv());
                    Buff.setRequiredDisableNAPtr(updatedBuff.getRequiredDisableNAPtr());
                    Buff.setRequiredTimerT1(updatedBuff.getRequiredTimerT1());
                    Buff.setRequiredTimerT1X64(updatedBuff.getRequiredTimerT1X64());
                    Buff.setRequiredTimerT2(updatedBuff.getRequiredTimerT2());
                    Buff.setRequiredTimerT4(updatedBuff.getRequiredTimerT4());
                    Buff.setRequiredRevision(updatedBuff.getRequiredRevision());
                } else {
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Expected a single-record response, " + resultSet.getRow() + " rows selected");
                }
            } catch (SQLException e) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "upd_fssfprofile() did not return a valid result cursor");
            } finally {
                if (resultSet != null) {
                    try {
                        resultSet.close();
                    } catch (SQLException e) {
                    }
                    resultSet = null;
                }
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "upd_fssfprofile() did not return a result cursor");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtUpdateByPKey != null) {
            try {
                stmtUpdateByPKey.close();
            } catch (SQLException e) {
            }
            stmtUpdateByPKey = null;
        }
    }
}

From source file:com.ibm.ioes.dao.ReportsDao.java

public ArrayList<NewOrderDto> viewContactList(NewOrderDto objDto) throws Exception {
    //Nagarjuna/*  ww w.j av a2  s  . c o m*/
    String methodName = "viewContactList", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end
    ArrayList<NewOrderDto> objUserList = new ArrayList<NewOrderDto>();
    Connection conn = null;
    CallableStatement proc = null;
    ResultSet rs = null;
    int recordCount = 0;

    try {
        String userName = "";

        conn = DbConnection.getReportsConnectionObject();

        proc = conn.prepareCall(sqlContactList);
        if (objDto.getAccountID() != 0) {
            proc.setLong(1, (objDto.getAccountID()));
        } else {
            proc.setNull(1, java.sql.Types.BIGINT);
        }
        if (objDto.getContactType() != null && !"".equals(objDto.getContactType())) {
            proc.setString(2, (objDto.getContactType()));
        } else {
            proc.setNull(2, java.sql.Types.VARCHAR);
        }

        if (objDto.getContactName() != null && !"".equals(objDto.getContactName())) {
            proc.setString(3, objDto.getContactName().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }
        if (objDto.getAccountName() != null && !"".equals(objDto.getAccountName())) {
            proc.setString(4, objDto.getAccountName().trim());
        } else {
            proc.setNull(4, java.sql.Types.VARCHAR);
        }
        if (objDto.getOrderNumber() != 0) {
            proc.setLong(5, (objDto.getOrderNumber()));
        } else {
            proc.setNull(5, java.sql.Types.BIGINT);
        }
        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(6, pagingSorting.getSortByColumn());// columnName
        proc.setString(7, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(8, pagingSorting.getStartRecordId());// start index
        proc.setInt(9, pagingSorting.getEndRecordId());// end index
        proc.setInt(10, (pagingSorting.isPagingToBeDone() ? 1 : 0));// end
        // index

        rs = proc.executeQuery();
        int countFlag = 0;
        while (rs.next() != false) {
            countFlag++;

            userName = (rs.getString("FIRSTNAME")) + " " + (rs.getString("LASTNAME"));
            objDto = new NewOrderDto();
            objDto.setContactName(userName);
            objDto.setAccountID(rs.getInt("ACCOUNTID"));
            objDto.setOrderNumber(rs.getInt("ORDERNO"));
            objDto.setContactId(rs.getLong("CONTACTID"));
            objDto.setContactType(rs.getString("CONTACTTYPE"));
            objDto.setSaluation(rs.getString("SALUATION"));
            objDto.setCntEmail(rs.getString("EMAIL"));
            objDto.setContactCell(rs.getString("CELLNO"));
            objDto.setContactFax(rs.getString("FAXNO"));
            objDto.setAddress1(rs.getString("ADDRESS1"));
            objDto.setAddress2(rs.getString("ADDRESS2"));
            objDto.setAddress3(rs.getString("ADDRESS3"));
            objDto.setCityName(rs.getString("CITY"));
            objDto.setStateName(rs.getString("STATE"));
            objDto.setCountyName(rs.getString("COUNTRY"));
            objDto.setPinNo(rs.getString("PINCODE"));
            objDto.setAccountName(rs.getString("ACCOUNTNAME"));

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
            }
            objUserList.add(objDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        //ex.printStackTrace();
        //throw new Exception("SQL Exception : " + ex.getMessage(), ex);
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(conn);

        } catch (Exception e) {
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
            //e.printStackTrace();
            //throw new Exception("Exception : " + e.getMessage(), e);
        }
    }

    return objUserList;
}

From source file:com.ibm.ioes.dao.ReportsDao.java

public ArrayList<DispatchAddressDto> viewDispatchAddressList(DispatchAddressDto objDto) throws Exception {
    //Nagarjuna/*from  www.  ja  va  2s . com*/
    String methodName = "viewDispatchAddressList", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end
    ArrayList<DispatchAddressDto> objUserList = new ArrayList<DispatchAddressDto>();
    Connection conn = null;
    CallableStatement proc = null;
    ResultSet rs = null;

    try {
        conn = DbConnection.getReportsConnectionObject();
        proc = conn.prepareCall(sqlDispatchList);

        if (objDto.getDispatchAddressId() != null && !"".equals(objDto.getDispatchAddressId())) {
            proc.setLong(2, Long.parseLong(objDto.getDispatchAddressId()));
        } else {
            proc.setNull(2, java.sql.Types.BIGINT);
        }
        if (objDto.getAccountID() != null && !"".equals(objDto.getAccountID())) {
            proc.setLong(1, Long.parseLong(objDto.getAccountID()));
        } else {
            proc.setNull(1, java.sql.Types.BIGINT);

        }

        if (objDto.getDispatchAddressName() != null && !"".equals(objDto.getDispatchAddressName())) {
            proc.setString(3, objDto.getDispatchAddressName().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }

        if (objDto.getAccountName() != null || !objDto.getAccountName().trim().equals("")) {
            proc.setString(4, objDto.getAccountName());
        } else {
            proc.setNull(4, java.sql.Types.VARCHAR);
        }

        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(5, pagingSorting.getSortByColumn());// columnName
        proc.setString(6, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(7, pagingSorting.getStartRecordId());// start index
        proc.setInt(8, pagingSorting.getEndRecordId());// end index
        proc.setInt(9, (pagingSorting.isPagingToBeDone() ? 1 : 0));// end
        // index

        rs = proc.executeQuery();
        int countFlag = 0;
        int recordCount = 0;

        while (rs.next() != false) {
            countFlag++;

            String userName = (rs.getString("FNAME")) + " " + (rs.getString("LNAME"));
            objDto = new DispatchAddressDto();
            objDto.setCustomerName(userName);
            objDto.setAccountID(String.valueOf(rs.getInt("ACCOUNTID")));
            objDto.setAccountName(rs.getString("ACCOUNTNAME"));
            objDto.setDispatchAddressId(String.valueOf(rs.getInt("DISPATCH_ADDRESS_CODE")));
            objDto.setDispatchAddressName(rs.getString("DISPATCHADDNAME"));
            objDto.setTelephonePhno(rs.getString("TELEPHONENO"));
            objDto.setEmail_Id(rs.getString("EMAIL_ID"));
            objDto.setAddress1(rs.getString("ADDRESS1"));
            objDto.setAddress2(rs.getString("ADDRESS2"));
            objDto.setAddress3(rs.getString("ADDRESS3"));
            objDto.setAddress4(rs.getString("ADDRESS4"));

            objDto.setFax(rs.getString("FAX"));
            objDto.setPin(rs.getString("PIN"));
            objDto.setTitle(rs.getString("TITLE"));
            objDto.setPostalCode(rs.getString("POSTAL_CODE"));
            objDto.setCountryName(rs.getString("COUNTRY_NAME"));
            objDto.setStateName(rs.getString("STATE_NAME"));
            objDto.setCityName(rs.getString("CITY_NAME"));

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
            }
            objUserList.add(objDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        //ex.printStackTrace();
        //throw new Exception("SQL Exception : " + ex.getMessage(), ex);
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(conn);

        } catch (Exception e) {
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
            //e.printStackTrace();
            throw new Exception("Exception : " + e.getMessage(), e);
        }
    }

    return objUserList;
}

From source file:com.ibm.ioes.dao.ReportsDao.java

public ArrayList<LocationDetailDto> viewCustomerLocationList(LocationDetailDto objDto) throws Exception {
    //Nagarjuna/*w  w  w.  j  a va  2 s . c o  m*/
    String methodName = "viewCustomerLocationList", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end
    ArrayList<LocationDetailDto> objUserList = new ArrayList<LocationDetailDto>();
    Connection conn = null;
    CallableStatement proc = null;
    ResultSet rs = null;
    int recordCount = 0;

    try {
        String userName = "";

        conn = DbConnection.getReportsConnectionObject();

        proc = conn.prepareCall(sqlGetCustomerLocReport);
        if (objDto.getLocationId() != null && !"".equals(objDto.getLocationId())) {
            proc.setLong(2, Long.parseLong(objDto.getLocationId()));
        } else {
            proc.setNull(2, java.sql.Types.BIGINT);
        }
        if (objDto.getAccountID() != null && !"".equals(objDto.getAccountID())) {
            proc.setLong(1, Long.parseLong(objDto.getAccountID()));
        } else {
            proc.setNull(1, java.sql.Types.BIGINT);
        }
        if (objDto.getLocationName() != null && !"".equals(objDto.getLocationName())) {
            proc.setString(3, objDto.getLocationName().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }
        if (objDto.getAccountName() != null && !"".equals(objDto.getAccountName())) {
            proc.setString(4, objDto.getAccountName().trim());
        } else {
            proc.setNull(4, java.sql.Types.VARCHAR);
        }
        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(5, pagingSorting.getSortByColumn());// columnName
        proc.setString(6, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(7, pagingSorting.getStartRecordId());// start index
        proc.setInt(8, pagingSorting.getEndRecordId());// end index
        proc.setInt(9, (pagingSorting.isPagingToBeDone() ? 1 : 0));// end
        // index

        rs = proc.executeQuery();
        int countFlag = 0;
        while (rs.next() != false) {
            countFlag++;

            userName = (rs.getString("FNAME")) + " " + (rs.getString("LNAME"));
            objDto = new LocationDetailDto();
            objDto.setCustomerName(userName);
            objDto.setAccountID(String.valueOf(rs.getInt("ACCOUNTID")));
            objDto.setLocationId(String.valueOf(rs.getInt("LOCATION_CODE")));
            objDto.setLocationName(rs.getString("LOCATION_NAME"));
            objDto.setTelephonePhno(rs.getString("TELEPHONENO"));
            objDto.setEmail_Id(rs.getString("EMAIL_ID"));
            objDto.setAddress1(rs.getString("ADDRESS1"));
            objDto.setAddress2(rs.getString("ADDRESS2"));
            objDto.setAddress3(rs.getString("ADDRESS3"));
            objDto.setAddress4(rs.getString("ADDRESS4"));
            objDto.setFax(rs.getString("FAX"));
            objDto.setPin(rs.getString("PIN"));
            objDto.setTitle(rs.getString("TITLE"));
            objDto.setCountryName(rs.getString("COUNTRY_NAME"));
            objDto.setPostalCode(rs.getString("POSTAL_CODE"));
            objDto.setStateName(rs.getString("STATE_NAME"));
            objDto.setCityName(rs.getString("CITY_NAME"));
            objDto.setAccountName(rs.getString("ACCOUNTNAME"));

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
            }
            objUserList.add(objDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        //ex.printStackTrace();
        //throw new Exception("SQL Exception : " + ex.getMessage(), ex);
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(conn);

        } catch (Exception e) {
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
            //e.printStackTrace();
            //throw new Exception("Exception : " + e.getMessage(), e);
        }
    }

    return objUserList;
}

From source file:com.ibm.ioes.dao.ReportsDao.java

public ArrayList<NewOrderDto> viewOrderStatusList(NewOrderDto objDto) throws Exception {
    //Nagarjuna//  www.j  a  v  a2s. c o m
    String methodName = "viewOrderStatusList", className = this.getClass().getName(), msg = "";
    boolean logToFile = true, logToConsole = true;
    //end
    ArrayList<NewOrderDto> objUserList = new ArrayList<NewOrderDto>();
    Connection conn = null;
    CallableStatement proc = null;
    ResultSet rs = null;
    int recordCount = 0;
    Utility utility = new Utility();
    DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    try {

        conn = DbConnection.getReportsConnectionObject();

        proc = conn.prepareCall(sqlOrderList);
        if (objDto.getAccountID() != 0) {
            proc.setLong(1, (objDto.getAccountID()));
        } else {
            proc.setNull(1, java.sql.Types.BIGINT);
        }
        if (objDto.getAccountName() != null && !"".equals(objDto.getAccountName())) {
            proc.setString(2, objDto.getAccountName().trim());
        } else {
            proc.setNull(2, java.sql.Types.VARCHAR);
        }
        if (objDto.getOrderType() != null && !"".equals(objDto.getOrderType())) {
            proc.setString(3, objDto.getOrderType().trim());
        } else {
            proc.setNull(3, java.sql.Types.VARCHAR);
        }

        if (objDto.getOrderNumber() != 0) {
            proc.setLong(4, objDto.getOrderNumber());
        } else {
            proc.setNull(4, java.sql.Types.BIGINT);
        }
        if (objDto.getFromDate() != null && !"".equals(objDto.getFromDate())) {
            proc.setString(5, objDto.getFromDate().trim());
        } else {
            proc.setNull(5, java.sql.Types.VARCHAR);
        }
        if (objDto.getToDate() != null && !"".equals(objDto.getToDate())) {
            proc.setString(6, objDto.getToDate().trim());
        } else {
            proc.setNull(6, java.sql.Types.VARCHAR);
        }

        PagingSorting pagingSorting = objDto.getPagingSorting();
        pagingSorting.sync();// To calculate start index and Enc Index

        proc.setString(7, pagingSorting.getSortByColumn());// columnName
        proc.setString(8, PagingSorting.DB_Asc_Desc(pagingSorting.getSortByOrder()));// sort order
        proc.setInt(9, pagingSorting.getStartRecordId());// start index
        proc.setInt(10, pagingSorting.getEndRecordId());// end index
        proc.setInt(11, (pagingSorting.isPagingToBeDone() ? 1 : 0));// end
        // index

        rs = proc.executeQuery();
        int countFlag = 0;
        while (rs.next() != false) {
            countFlag++;

            objDto = new NewOrderDto();
            objDto.setAccountID(rs.getInt("ACCOUNTID"));
            objDto.setAccountName(rs.getString("ACCOUNTNAME"));
            objDto.setOrderNumber(rs.getInt("ORDERNO"));
            objDto.setOrderType(rs.getString("ORDERTYPE"));
            objDto.setOrderDate(rs.getString("ORDERDATE"));
            if (rs.getString("ORDERDATE") != null && !"".equals(rs.getString("ORDERDATE"))) {

                Date date = df.parse(objDto.getOrderDate());
                objDto.setOrderDate((utility.showDate_Report(date)).toUpperCase());

            }
            objDto.setSourceName(rs.getString("SOURCE"));
            objDto.setQuoteNo(rs.getString("QUOTENO"));
            objDto.setCurrencyName(rs.getString("CURNAME"));
            // objDto.setStatus(new
            // Integer(rs.getString("STATUS")).intValue());
            objDto.setStageName(rs.getString("STAGE"));
            //[131] START
            objDto.setPartnerCode(rs.getString("PARTNER_CODE"));
            objDto.setFieldEngineer(rs.getString("FIELD_ENGINEER"));
            objDto.setChannelPartner(rs.getString("PARTNER_NAME"));
            //[131] END

            if (pagingSorting.isPagingToBeDone()) {
                recordCount = rs.getInt("FULL_REC_COUNT");
            }
            objUserList.add(objDto);
        }
        pagingSorting.setRecordCount(recordCount);
    } catch (Exception ex) {
        Utility.onEx_LOG_RET_NEW_EX(ex, methodName, className, msg, logToFile, logToConsole);//nagarjuna
        //ex.printStackTrace();
        throw new Exception("SQL Exception : " + ex.getMessage(), ex);
    } finally {
        try {
            DbConnection.closeResultset(rs);
            DbConnection.closeCallableStatement(proc);
            DbConnection.freeConnection(conn);

        } catch (Exception e) {
            Utility.onEx_LOG_RET_NEW_EX(e, methodName, className, msg, logToFile, logToConsole);//nagarjuna
            //e.printStackTrace();
            throw new Exception("Exception : " + e.getMessage(), e);
        }
    }

    return objUserList;
}