pagecode.RPTs.OffenceUtil.java Source code

Java tutorial

Introduction

Here is the source code for pagecode.RPTs.OffenceUtil.java

Source

/*
 * Created on Oct 25, 2007
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package pagecode.RPTs;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.logging.Logger;

import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang.StringUtils;

import pagecode.PageCodeBase;
import IntegrationObject.BackToMenu_Access;
import IntegrationObject.OffenceInfo_am_Access;
import IntegrationObject.OffenceInfo_am_Integrated_Access;

/**
 * @author mazzawa
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class OffenceUtil implements ReportConstants {
    private static final Logger logger = Logger.getLogger(OffenceUtil.class.getName());

    //Case Number
    private String courtOfficeId;
    private String jurisdictionNumber;
    private String infoYear;
    private String infoPrefix;
    private String infoSuffix;
    private String countNumber;
    private boolean runAsStandAlone = false;

    private String paramOffenceNumber;
    private String paramOffenceDate;
    private String paramOfficerNumber;
    private String paramDriversLicenseNumber;
    private String paramPlateNumber;
    private String paramEnforcementAgency;
    private String paramSex;
    private String paramDateOfBirth;
    private String paramCVOR;
    private String paramUnit;
    private String paramOffenderFullName;
    private String paramAddressLine1;
    private String paramAddressLine2;
    private String paramAddressLine3;
    private String paramOffenceDay;
    private String paramOffenceMonth;
    private String paramOffenceYear;
    private String paramOffenceTime;
    private String paramOffenceLocation;
    private String paramOffenceDesc;
    private String paramOffenceStatue;
    private String paramOffenceSection;
    private String paramOffenceTotalPayable;
    private String paramInterpreterLanguage;

    //Feb 19, 2009 - Anan
    private String paramTrialDay;
    private String paramTrialMonth;
    private String paramTrailYear;
    private String paramTrailTimeHour;
    private String paramTrailTimeMinute;
    private String paramTrailRoom;
    private String paramTrailLocationCourtId;

    private String returnMessage;

    //Default is English
    private boolean isEnglish = true;

    //Jan 16, 2009 - Anan
    private HttpServletRequest request;

    //Added Mar 0, 2009 - Anan
    private String paramSentenceDateDay;
    private String paramSentenceDateMonth;
    private String paramSentenceDateYear;

    //Dec 17, 2007 - Anan
    //New Stuff to get this to work with the HATS insted of IICF
    //private boolean isOffenceStatuteCriteriaSet = false;
    //   private String OCNT_STATU_CD;
    //   private String OCNT_SCTN_ID;
    //   private String OCNT_SUB_SCTN_ID;
    //   private String OCNT_PARA_ID;
    //   private String OCNT_OFNC_CLAS_ID;
    //   private String OCNT_BYLAW_CD;

    //Sep 13, 2011 - Anan
    //Added AppearanceType screen scraping param
    private String paramAppearanceType;

    public OffenceUtil() {
        super();
    }

    public void setOffenceUtil(String courtOfficeId, String jurisdictionNumber, String infoYear, String infoPrefix,
            String infoSuffix) throws Exception {
        //      if(false == isOffenceStatuteCriteriaSet) {
        //         throw new Exception("Offence Statute Criteria is not set. Must set the OCNT_STATU_CD, OCNT_SCTN_ID, OCNT_SUB_SCTN_ID etc.");
        //      }
        this.courtOfficeId = courtOfficeId;
        this.jurisdictionNumber = jurisdictionNumber;
        this.infoYear = infoYear;
        this.infoPrefix = infoPrefix;
        this.infoSuffix = infoSuffix;
        processOffenceInfo();
    }

    public void setOffenceUtil(String courtOfficeId, String jurisdictionNumber, String infoYear, String infoPrefix,
            String infoSuffix, HttpServletRequest request) throws Exception {
        if (request == null) {
            throw new Exception("OffenceUtil::setOffenceUtil: request is null");
        }
        this.request = request;
        setOffenceUtil(courtOfficeId, jurisdictionNumber, infoYear, infoPrefix, infoSuffix);
    }

    public void setOffenceUtil(String courtOfficeId, String jurisdictionNumber, String infoYear, String infoPrefix,
            String infoSuffix, HttpServletRequest request, String countNumber) throws Exception {
        if (request == null) {
            throw new Exception("OffenceUtil::setOffenceUtil: request is null");
        }
        this.request = request;
        this.countNumber = countNumber;
        setOffenceUtil(courtOfficeId, jurisdictionNumber, infoYear, infoPrefix, infoSuffix);
    }

    //   public void setOffenceStatuteCriteria(
    //         String OCNT_STATU_CD,
    //         String OCNT_SCTN_ID,
    //         String OCNT_SUB_SCTN_ID,
    //         String OCNT_PARA_ID,
    //         String OCNT_OFNC_CLAS_ID,
    //         String OCNT_BYLAW_CD){
    //      this.OCNT_STATU_CD = OCNT_STATU_CD;
    //      this.OCNT_SCTN_ID = OCNT_SCTN_ID;
    //      this.OCNT_SUB_SCTN_ID = OCNT_SUB_SCTN_ID;
    //      this.OCNT_PARA_ID = OCNT_PARA_ID;
    //      this.OCNT_OFNC_CLAS_ID = OCNT_OFNC_CLAS_ID;
    //      this.OCNT_BYLAW_CD = OCNT_BYLAW_CD;
    //      isOffenceStatuteCriteriaSet = true;
    //   }

    private void processOffenceInfo() {
        logger.info("In OffenceUtil::processOffenceInfo");

        if (true == isOffenceNumberValid()) {
            //TODO fix this to throw Exception
            if (this.request == null) {
                return;
            }
            HttpSession session = this.request.getSession();

            try {
                //Map session = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();

                BackToMenu_Access backToMenu_Access = new BackToMenu_Access();
                PageCodeBase.executeEJB(backToMenu_Access, session);

                OffenceInfo_am_Integrated_Access offenceInfo_am_Integrated_Access = new OffenceInfo_am_Integrated_Access();

                offenceInfo_am_Integrated_Access.setCrt(StringUtils.rightPad(courtOfficeId.trim(), 4));
                offenceInfo_am_Integrated_Access.setJur(StringUtils.rightPad(jurisdictionNumber.trim(), 3));
                offenceInfo_am_Integrated_Access.setYr(StringUtils.rightPad(infoYear.trim(), 2));
                offenceInfo_am_Integrated_Access.setInfPart1(StringUtils.rightPad(infoPrefix.trim(), 8));
                offenceInfo_am_Integrated_Access.setInfPart2(StringUtils.rightPad(infoSuffix.trim(), 2));

                if (null != countNumber && !countNumber.equals("")) {
                    if (countNumber.trim().length() < 4) {
                        countNumber = StringUtils.leftPad(countNumber.trim(), 4, "0");
                    }
                    offenceInfo_am_Integrated_Access.setOther(StringUtils.rightPad(countNumber, 20));
                }

                PageCodeBase.executeEJB(offenceInfo_am_Integrated_Access, session);

                if (!offenceInfo_am_Integrated_Access.getReturnMessage().trim().equals("")) {
                    throw new Exception(offenceInfo_am_Integrated_Access.getReturnMessage().trim());
                }

                paramOffenceNumber = courtOfficeId + " " + jurisdictionNumber + " " + infoYear + " " + infoPrefix
                        + " " + infoSuffix;

                //Always sssume  English
                isEnglish = true;
                if ("F".equalsIgnoreCase(offenceInfo_am_Integrated_Access.getLanguageCode().trim())) {
                    isEnglish = false;
                }
                //NOTE: if runAsStandAlone == true then assume it is always French
                if (true == runAsStandAlone) {
                    isEnglish = false;
                }

                paramInterpreterLanguage = offenceInfo_am_Integrated_Access.getInterpreterLangCode().trim();
                if (!paramInterpreterLanguage.equals("")) {
                    InterpreterLanguageUtil interpreterLanguageUtil = new InterpreterLanguageUtil();
                    interpreterLanguageUtil.setIsEnglish(isEnglish);
                    interpreterLanguageUtil.setInterpreterLanguageUtil(paramInterpreterLanguage);
                    paramInterpreterLanguage = interpreterLanguageUtil.getInterpreterLanguageDesc();
                }

                IconDateUtil offenceDateUtil = new IconDateUtil();
                offenceDateUtil.setIsEnglish(isEnglish);

                paramOffenceDate = ""; //YYMMDD
                if (!offenceInfo_am_Integrated_Access.getOffenceDateYear().trim().equals("")
                        && !offenceInfo_am_Integrated_Access.getOffenceDateMonth().trim().equals("")
                        && !offenceInfo_am_Integrated_Access.getOffenceDateDay().trim().equals("")) {

                    offenceDateUtil.setIconDate(offenceInfo_am_Integrated_Access.getOffenceDateYear().trim()
                            + offenceInfo_am_Integrated_Access.getOffenceDateMonth().trim()
                            + offenceInfo_am_Integrated_Access.getOffenceDateDay().trim());

                    paramOffenceDate = offenceDateUtil.getDateWithSlashes();
                }

                paramOfficerNumber = offenceInfo_am_Integrated_Access.getOfficerNumber().trim();

                paramDriversLicenseNumber = offenceInfo_am_Integrated_Access.getDriversLicense().trim();

                paramPlateNumber = offenceInfo_am_Integrated_Access.getPlateNumber().trim();

                paramEnforcementAgency = offenceInfo_am_Integrated_Access.getEnforcementAgency().trim();

                paramSex = offenceInfo_am_Integrated_Access.getSex().trim();

                paramDateOfBirth = ""; //YYMMDD
                IconDateUtil dateOfBirthUtil = new IconDateUtil();
                dateOfBirthUtil.setIsEnglish(isEnglish);

                if (!offenceInfo_am_Integrated_Access.getDateOfBirthYear().trim().equals("")
                        && !offenceInfo_am_Integrated_Access.getDateOfBirthMonth().trim().equals("")
                        && !offenceInfo_am_Integrated_Access.getDateOfBirthDay().trim().equals("")) {

                    dateOfBirthUtil.setIconDate(offenceInfo_am_Integrated_Access.getDateOfBirthYear().trim()
                            + offenceInfo_am_Integrated_Access.getDateOfBirthMonth().trim()
                            + offenceInfo_am_Integrated_Access.getDateOfBirthDay().trim());

                    paramDateOfBirth = dateOfBirthUtil.getDateWithSlashes();
                }

                paramCVOR = offenceInfo_am_Integrated_Access.getCvor().trim();

                paramUnit = offenceInfo_am_Integrated_Access.getUnit().trim();

                paramOffenderFullName = offenceInfo_am_Integrated_Access.getFirstName().trim();
                paramOffenderFullName += " " + offenceInfo_am_Integrated_Access.getInitial().trim();
                paramOffenderFullName += " " + offenceInfo_am_Integrated_Access.getLastName().trim();

                paramAddressLine1 = offenceInfo_am_Integrated_Access.getAddressStreet().trim();

                paramAddressLine2 = offenceInfo_am_Integrated_Access.getAddressCity().trim();
                paramAddressLine2 += ", " + offenceInfo_am_Integrated_Access.getAddressProvince().trim();

                paramAddressLine3 = offenceInfo_am_Integrated_Access.getAddressPostal().trim();

                //Modified 2008-02-28 per Janes request
                //paramOffenceDay = offenceDateUtil.getStrDay();
                paramOffenceDay = offenceDateUtil.getDayNonFormatted();
                paramOffenceMonth = offenceDateUtil.getStrMonth();
                paramOffenceYear = offenceDateUtil.getStrYear();

                paramOffenceTime = "";
                if (!offenceInfo_am_Integrated_Access.getOffenceDateTimeHour().trim().equals("")
                        && !offenceInfo_am_Integrated_Access.getOffenceDateTimeMinute().trim().equals("")) {

                    offenceDateUtil.setIconTime(offenceInfo_am_Integrated_Access.getOffenceDateTimeHour().trim()
                            + offenceInfo_am_Integrated_Access.getOffenceDateTimeMinute().trim());
                    paramOffenceTime = offenceDateUtil.getFormatedTime();
                }

                paramOffenceLocation = offenceInfo_am_Integrated_Access.getOffenceLocation().trim();

                //Feb 16, 2009 - Anan
                paramTrialDay = offenceInfo_am_Integrated_Access.getTrialDay().trim();
                paramTrialMonth = offenceInfo_am_Integrated_Access.getTrialMonth().trim();
                paramTrailYear = offenceInfo_am_Integrated_Access.getTrailYear().trim();
                paramTrailTimeHour = offenceInfo_am_Integrated_Access.getTrailTimeHour().trim();
                paramTrailTimeMinute = offenceInfo_am_Integrated_Access.getTrailTimeMinute().trim();
                paramTrailRoom = offenceInfo_am_Integrated_Access.getTrailRoom().trim();
                paramTrailLocationCourtId = offenceInfo_am_Integrated_Access.getTrailLocationCourtId().trim();

                //Added Mar 2, 2009 - Anan
                paramSentenceDateDay = offenceInfo_am_Integrated_Access.getSentenceDateDay().trim();
                paramSentenceDateMonth = offenceInfo_am_Integrated_Access.getSentenceDateMonth().trim();
                paramSentenceDateYear = offenceInfo_am_Integrated_Access.getSentenceDateYear().trim();

                OffenceStatuteDescriptionUtil offenceStatuteDescriptionUtil = new OffenceStatuteDescriptionUtil();

                offenceStatuteDescriptionUtil.setIsEnglish(this.isEnglish);
                //            logger.info("Before setOffenceStatuteDescriptionUtil(...)\n" + 
                //                  this.OCNT_STATU_CD + " " +
                //                  this.OCNT_SCTN_ID + " " +
                //                  this.OCNT_SUB_SCTN_ID + " " +
                //                  this.OCNT_PARA_ID + " " +
                //                  this.OCNT_OFNC_CLAS_ID + " " + 
                //                  this.OCNT_BYLAW_CD
                //            );
                //            offenceStatuteDescriptionUtil.setOffenceStatuteDescriptionUtil(
                //               this.OCNT_STATU_CD,
                //               this.OCNT_SCTN_ID,
                //               this.OCNT_SUB_SCTN_ID,
                //               this.OCNT_PARA_ID,
                //               this.OCNT_OFNC_CLAS_ID,
                //               this.OCNT_BYLAW_CD, offenceDateUtil
                //            );
                //            Modified by Anan
                //            January 14, 2009
                //            To integrate the French NoT into ICON v2.2            
                offenceStatuteDescriptionUtil.setOffenceStatuteDescriptionUtil(
                        offenceInfo_am_Integrated_Access.getOffenceStatute().trim(),
                        offenceInfo_am_Integrated_Access.getOffenceSection().trim(),
                        offenceInfo_am_Integrated_Access.getOffenceSubSection().trim(),
                        offenceInfo_am_Integrated_Access.getOffenceParagraph().trim(),
                        offenceInfo_am_Integrated_Access.getOffenceClause().trim(),
                        offenceInfo_am_Integrated_Access.getOffenceByLaw().trim(), offenceDateUtil);

                paramOffenceDesc = offenceStatuteDescriptionUtil.getOffenceDescription();
                paramOffenceStatue = offenceStatuteDescriptionUtil.getStatuteDescription();

                paramOffenceSection = offenceInfo_am_Integrated_Access.getOffenceSection().trim();

                if (!offenceInfo_am_Integrated_Access.getOffenceSubSection().trim().equals("")) {
                    paramOffenceSection += "(" + offenceInfo_am_Integrated_Access.getOffenceSubSection().trim()
                            + ")";
                }
                if (!offenceInfo_am_Integrated_Access.getOffenceParagraph().trim().equals("")) {
                    paramOffenceSection += "(" + offenceInfo_am_Integrated_Access.getOffenceParagraph().trim()
                            + ")";
                }
                if (!offenceInfo_am_Integrated_Access.getOffenceClause().trim().equals("")) {
                    paramOffenceSection += "(" + offenceInfo_am_Integrated_Access.getOffenceClause().trim() + ")";
                }

                paramOffenceTotalPayable = "";
                BigDecimal totalPayable;
                String tempAmount;
                tempAmount = offenceInfo_am_Integrated_Access.getOutstandingFineAmount().trim();
                BigDecimal outstandingFineAmount = new BigDecimal(
                        (null != tempAmount && !tempAmount.equals("") ? tempAmount : "0.0"));
                tempAmount = offenceInfo_am_Integrated_Access.getOutstandingCostAmount().trim();
                BigDecimal outstandingCostAmount = new BigDecimal(
                        (null != tempAmount && !tempAmount.equals("") ? tempAmount : "0.0"));
                totalPayable = outstandingFineAmount.add(outstandingCostAmount);

                NumberFormat formatUS = NumberFormat.getCurrencyInstance(Locale.US);
                paramOffenceTotalPayable = formatUS.format(totalPayable.doubleValue());

                //Added Sep 13, 2011 to screenscrap appearance type
                paramAppearanceType = offenceInfo_am_Integrated_Access.getAppearanceType().trim();

            } catch (Exception e) {
                paramOffenceNumber = "";
                paramOffenceDate = "";
                paramOfficerNumber = "";
                paramDriversLicenseNumber = "";
                paramPlateNumber = "";
                paramEnforcementAgency = "";
                paramSex = "";
                paramDateOfBirth = "";
                paramCVOR = "";
                paramUnit = "";
                paramOffenderFullName = "";
                paramAddressLine1 = "";
                paramAddressLine2 = "";
                paramAddressLine3 = "";
                paramOffenceDay = "";
                paramOffenceMonth = "";
                paramOffenceYear = "";
                paramOffenceTime = "";
                paramOffenceLocation = "";
                paramOffenceDesc = "";
                paramOffenceStatue = "";
                paramOffenceSection = "";
                paramOffenceTotalPayable = "";
                paramInterpreterLanguage = "";

                //Feb 16, 2009 - Anan
                paramTrialDay = "";
                paramTrialMonth = "";
                paramTrailYear = "";
                paramTrailTimeHour = "";
                paramTrailTimeMinute = "";
                paramTrailRoom = "";
                paramTrailLocationCourtId = "";

                //Added Mar 2, 2009 - Anan
                paramSentenceDateDay = "";
                paramSentenceDateMonth = "";
                paramSentenceDateYear = "";

                //Added Sep 13, 2011 - Anan
                paramAppearanceType = "";

                returnMessage = e.getMessage();
                e.printStackTrace();
            } finally {
                BackToMenu_Access backToMenu_Access = new BackToMenu_Access();
                PageCodeBase.executeEJB(backToMenu_Access, session);
            }
        } //if(true == isOffenceNumberValid())

    }

    private void processOffenceInfoOld() {
        logger.info("In OffenceUtil::processOffenceInfoOld");
        String selectSql = null;
        Connection iicfConnection = ReportsConnectionManager.getIICFConnection();
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;

        if (null != iicfConnection && true == isOffenceNumberValid()) {
            try {
                String dbLetterPrefix;

                //If Offence is Red Light Camera or parking tickets then use 
                //the "P" database [The photo radar DB] in IMS i.e. "P" tables in IICF
                if ("997".equals(jurisdictionNumber) || "901".equals(jurisdictionNumber)) {
                    dbLetterPrefix = "P";
                } else {
                    dbLetterPrefix = "O";
                }

                selectSql = "SELECT " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_CRT_OFC AS OFCS_CRT_OFC, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix
                        + "FCS." + dbLetterPrefix + "FCS_JRSDCTN_NUM AS OFCS_JRSDCTN_NUM, " + " " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_YY AS OFCS_INFO_YY, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_INFO_PREFIX AS OFCS_INFO_PREFIX, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_SUFFIX AS OFCS_INFO_SUFFIX, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_TRL_LANG_CD AS OFCS_TRL_LANG_CD, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INTERP_LANG_CD AS OFCS_INTERP_LANG_CD, "
                        + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix
                        + "CNT_CNT_NUM AS OCNT_CNT_NUM, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix
                        + "CNT." + dbLetterPrefix + "CNT_OFNC_DT AS OCNT_OFNC_DT, " + " " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_OFCR_BDG_NUM AS OFCS_OFCR_BDG_NUM, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_LIC_PLATE_NUM AS OFCS_LIC_PLATE_NUM, "
                        + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_DRVR_LIC_PART_1 AS OFCS_DRVR_LIC_PART_1, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_DRVR_LIC_PART_2 AS OFCS_DRVR_LIC_PART_2, "
                        + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_DRVR_LIC_PART_3 AS OFCS_DRVR_LIC_PART_3, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_ENF_AGCY AS OFCS_ENF_AGCY, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_SEX_CD AS OFCS_SEX_CD, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                        + dbLetterPrefix + "FCS_BRTH_DT AS OFCS_BRTH_DT, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "CNT." + dbLetterPrefix + "CNT_CVOR_NUM AS OCNT_CVOR_NUM, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_ENF_AGCY_DIV_CD AS OFCS_ENF_AGCY_DIV_CD, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_GVN_NM AS OFCS_GVN_NM, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_INIT AS OFCS_INIT, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                        + dbLetterPrefix + "FCS_SRNM AS OFCS_SRNM, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_ADDR_ST AS OFCS_ADDR_ST, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_ADDR_CTY AS OFCS_ADDR_CTY, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix
                        + "FCS." + dbLetterPrefix + "FCS_ADDR_PROV AS OFCS_ADDR_PROV, " + " " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                        + "FCS_ADDR_PSTL_CD AS OFCS_ADDR_PSTL_CD, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "CNT." + dbLetterPrefix + "CNT_TM AS OCNT_TM, " + " " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix + "CNT_LOCN_DESC AS OCNT_LOCN_DESC, "
                        + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix
                        + "CNT_STATU_CD AS OCNT_STATU_CD, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix
                        + "CNT." + dbLetterPrefix + "CNT_SCTN_ID AS OCNT_SCTN_ID, " + " " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix
                        + "CNT_SUB_SCTN_ID AS OCNT_SUB_SCTN_ID, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "CNT." + dbLetterPrefix + "CNT_PARA_ID AS OCNT_PARA_ID, " + " "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix
                        + "CNT_OFNC_CLAS_ID AS OCNT_OFNC_CLAS_ID, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "CNT." + dbLetterPrefix + "CNT_BYLAW_CD AS OCNT_BYLAW_CD " + "FROM  "
                        + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS, " + " " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "CNT " + "WHERE " + " " + ICON_SCHEMA_NAME + ".ICOS"
                        + dbLetterPrefix + "CNT." + dbLetterPrefix + "CNT_CNT_NUM = '0001' " + " AND "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_CRT_OFC = '"
                        + courtOfficeId + "' " + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                        + dbLetterPrefix + "FCS_JRSDCTN_NUM = '" + jurisdictionNumber + "' " + " AND "
                        + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_YY = '"
                        + infoYear + "' " + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                        + dbLetterPrefix + "FCS_INFO_PREFIX = '" + infoPrefix + "' " + " AND " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_SUFFIX = '" + infoSuffix
                        + "' " + " " + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "CNT."
                        + dbLetterPrefix + "FCS_CRT_OFC = '" + courtOfficeId + "' " + " AND " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix + "FCS_JRSDCTN_NUM = '"
                        + jurisdictionNumber + "' " + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "CNT."
                        + dbLetterPrefix + "FCS_INFO_YY = '" + infoYear + "' " + " AND " + ICON_SCHEMA_NAME
                        + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix + "FCS_INFO_PREFIX = '" + infoPrefix
                        + "' " + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "CNT." + dbLetterPrefix
                        + "FCS_INFO_SUFFIX = '" + infoSuffix + "' ";
                selectSql += " ";
                logger.info("+++++SQL: " + selectSql);

                //TODO remove this
                if (true) {
                    //return;
                }
                preparedStatement = iicfConnection.prepareStatement(selectSql, ResultSet.TYPE_SCROLL_INSENSITIVE,
                        ResultSet.CONCUR_READ_ONLY);

                resultSet = preparedStatement.executeQuery();

                resultSet.last();
                int resultSetCount = resultSet.getRow();
                logger.info("resultSetCount: " + resultSetCount);
                resultSet.beforeFirst();

                if (resultSetCount != 1) {
                    throw new Exception("Offence NOT found or MORE than one found!!!");
                } else {
                    //move to first record
                    resultSet.next();

                    paramOffenceNumber = "";
                    if (null != resultSet.getString("OFCS_CRT_OFC")) {
                        paramOffenceNumber = resultSet.getString("OFCS_CRT_OFC").trim() + " ";
                    }
                    if (null != resultSet.getString("OFCS_JRSDCTN_NUM")) {
                        paramOffenceNumber += resultSet.getString("OFCS_JRSDCTN_NUM").trim() + " ";
                    }
                    if (null != resultSet.getString("OFCS_INFO_YY")) {
                        paramOffenceNumber += resultSet.getString("OFCS_INFO_YY").trim() + " ";
                    }
                    if (null != resultSet.getString("OFCS_INFO_PREFIX")) {
                        paramOffenceNumber += resultSet.getString("OFCS_INFO_PREFIX").trim() + " ";
                    }
                    if (null != resultSet.getString("OFCS_INFO_SUFFIX")) {
                        paramOffenceNumber += resultSet.getString("OFCS_INFO_SUFFIX").trim();
                    }

                    if (null != resultSet.getString("OFCS_TRL_LANG_CD")) {
                        String langChar = resultSet.getString("OFCS_TRL_LANG_CD").trim();
                        isEnglish = (true == langChar.equalsIgnoreCase("F") ? false : true);
                    }

                    //NOTE: if runAsStandAlone == true then assume it is always French
                    if (true == runAsStandAlone) {
                        this.isEnglish = false;
                    }

                    paramInterpreterLanguage = "";
                    if (null != resultSet.getString("OFCS_INTERP_LANG_CD")
                            && !resultSet.getString("OFCS_INTERP_LANG_CD").trim().equals("")) {
                        paramInterpreterLanguage = resultSet.getString("OFCS_INTERP_LANG_CD").trim();
                        InterpreterLanguageUtil interpreterLanguageUtil = new InterpreterLanguageUtil();
                        interpreterLanguageUtil.setIsEnglish(this.isEnglish());
                        interpreterLanguageUtil.setInterpreterLanguageUtil(paramInterpreterLanguage);
                        paramInterpreterLanguage = interpreterLanguageUtil.getInterpreterLanguageDesc();
                    }

                    IconDateUtil offenceDateUtil = new IconDateUtil();
                    offenceDateUtil.setIsEnglish(this.isEnglish);

                    paramOffenceDate = "";
                    if (null != resultSet.getString("OCNT_OFNC_DT")) {
                        offenceDateUtil.setIconDate(resultSet.getString("OCNT_OFNC_DT").trim());
                        paramOffenceDate = offenceDateUtil.getDateWithSlashes();
                    }

                    paramOfficerNumber = "";
                    if (null != resultSet.getString("OFCS_OFCR_BDG_NUM")) {
                        paramOfficerNumber = resultSet.getString("OFCS_OFCR_BDG_NUM").trim();
                    }

                    paramDriversLicenseNumber = "";
                    if (null != resultSet.getString("OFCS_DRVR_LIC_PART_1")
                            && null != resultSet.getString("OFCS_DRVR_LIC_PART_2")
                            && null != resultSet.getString("OFCS_DRVR_LIC_PART_1")) {
                        paramDriversLicenseNumber = resultSet.getString("OFCS_DRVR_LIC_PART_1").trim() + "-"
                                + resultSet.getString("OFCS_DRVR_LIC_PART_2").trim() + "-"
                                + resultSet.getString("OFCS_DRVR_LIC_PART_3").trim();
                    }

                    paramPlateNumber = "";
                    if (null != resultSet.getString("OFCS_LIC_PLATE_NUM")) {
                        paramPlateNumber = resultSet.getString("OFCS_LIC_PLATE_NUM").trim();
                    }

                    paramEnforcementAgency = "";
                    if (null != resultSet.getString("OFCS_ENF_AGCY")) {
                        paramEnforcementAgency = resultSet.getString("OFCS_ENF_AGCY").trim();
                    }

                    paramSex = "";
                    if (null != resultSet.getString("OFCS_SEX_CD")) {
                        paramSex = resultSet.getString("OFCS_SEX_CD").trim();
                    }

                    paramDateOfBirth = "";
                    IconDateUtil dateOfBirthUtil = new IconDateUtil();
                    if (null != resultSet.getString("OFCS_BRTH_DT")) {
                        dateOfBirthUtil.setIconDate(resultSet.getString("OFCS_BRTH_DT").trim());
                        paramDateOfBirth = dateOfBirthUtil.getDateWithSlashes();
                    }

                    paramCVOR = "";
                    if (null != resultSet.getString("OCNT_CVOR_NUM")) {
                        paramCVOR = resultSet.getString("OCNT_CVOR_NUM").trim();
                    }

                    paramUnit = "";
                    if (null != resultSet.getString("OFCS_ENF_AGCY_DIV_CD")) {
                        paramUnit = resultSet.getString("OFCS_ENF_AGCY_DIV_CD").trim();
                    }

                    paramOffenderFullName = "";
                    if (null != resultSet.getString("OFCS_GVN_NM")) {
                        paramOffenderFullName = resultSet.getString("OFCS_GVN_NM").trim() + " ";
                    }
                    if (null != resultSet.getString("OFCS_INIT")) {
                        paramOffenderFullName += resultSet.getString("OFCS_INIT").trim() + " ";
                    }
                    if (null != resultSet.getString("OFCS_SRNM")) {
                        paramOffenderFullName += resultSet.getString("OFCS_SRNM").trim();
                    }

                    paramAddressLine1 = "";
                    if (null != resultSet.getString("OFCS_ADDR_ST")) {
                        paramAddressLine1 = resultSet.getString("OFCS_ADDR_ST").trim();
                    }

                    paramAddressLine2 = "";
                    if (null != resultSet.getString("OFCS_ADDR_CTY")) {
                        paramAddressLine2 = resultSet.getString("OFCS_ADDR_CTY").trim();
                    }
                    if (null != resultSet.getString("OFCS_ADDR_PROV")) {
                        paramAddressLine2 += ", " + resultSet.getString("OFCS_ADDR_PROV").trim();
                    }

                    if (null != resultSet.getString("OFCS_ADDR_PSTL_CD")) {
                        paramAddressLine3 = resultSet.getString("OFCS_ADDR_PSTL_CD").trim();
                    }

                    paramOffenceDay = paramOffenceMonth = paramOffenceYear = "";
                    if (null != resultSet.getString("OCNT_OFNC_DT")) {
                        offenceDateUtil.setIconDate(resultSet.getString("OCNT_OFNC_DT").trim());
                        paramOffenceDay = offenceDateUtil.getStrDay();
                        paramOffenceMonth = offenceDateUtil.getStrMonth();
                        paramOffenceYear = offenceDateUtil.getStrYear();
                    }
                    //offenceDateUtil = iconDateUtil;

                    paramOffenceTime = "";
                    if (null != resultSet.getString("OCNT_TM")) {
                        offenceDateUtil.setIconTime(resultSet.getString("OCNT_TM").trim());
                        paramOffenceTime = offenceDateUtil.getFormatedTime();
                    }

                    paramOffenceLocation = "";
                    if (null != resultSet.getString("OCNT_LOCN_DESC")) {
                        paramOffenceLocation = resultSet.getString("OCNT_LOCN_DESC").trim();
                    }

                    String tempOCNT_STATU_CD, tempOCNT_SCTN_ID, tempOCNT_SUB_SCTN_ID, tempOCNT_PARA_ID,
                            tempOCNT_OFNC_CLAS_ID, tempOCNT_BYLAW_CD;

                    tempOCNT_STATU_CD = "";
                    if (null != resultSet.getString("OCNT_STATU_CD")) {
                        tempOCNT_STATU_CD = resultSet.getString("OCNT_STATU_CD").trim();
                    }

                    tempOCNT_SCTN_ID = "";
                    if (null != resultSet.getString("OCNT_SCTN_ID")) {
                        tempOCNT_SCTN_ID = resultSet.getString("OCNT_SCTN_ID").trim();
                    }

                    tempOCNT_SUB_SCTN_ID = null;
                    if (null != resultSet.getString("OCNT_SUB_SCTN_ID")) {
                        tempOCNT_SUB_SCTN_ID = resultSet.getString("OCNT_SUB_SCTN_ID").trim();
                    }

                    tempOCNT_PARA_ID = null;
                    if (null != resultSet.getString("OCNT_PARA_ID")) {
                        tempOCNT_PARA_ID = resultSet.getString("OCNT_PARA_ID").trim();
                    }

                    tempOCNT_OFNC_CLAS_ID = null;
                    if (null != resultSet.getString("OCNT_OFNC_CLAS_ID")) {
                        tempOCNT_OFNC_CLAS_ID = resultSet.getString("OCNT_OFNC_CLAS_ID").trim();
                    }

                    tempOCNT_BYLAW_CD = null;
                    if (null != resultSet.getString("OCNT_BYLAW_CD")) {
                        tempOCNT_BYLAW_CD = resultSet.getString("OCNT_BYLAW_CD").trim();
                    }

                    OffenceStatuteDescriptionUtil offenceStatuteDescriptionUtil = new OffenceStatuteDescriptionUtil();

                    offenceStatuteDescriptionUtil.setIsEnglish(this.isEnglish);
                    offenceStatuteDescriptionUtil.setOffenceStatuteDescriptionUtil(tempOCNT_STATU_CD,
                            tempOCNT_SCTN_ID, tempOCNT_SUB_SCTN_ID, tempOCNT_PARA_ID, tempOCNT_OFNC_CLAS_ID,
                            tempOCNT_BYLAW_CD, offenceDateUtil);

                    paramOffenceDesc = offenceStatuteDescriptionUtil.getOffenceDescription();
                    paramOffenceStatue = offenceStatuteDescriptionUtil.getStatuteDescription();

                    paramOffenceSection = tempOCNT_SCTN_ID;
                    if (null != tempOCNT_SUB_SCTN_ID && !tempOCNT_SUB_SCTN_ID.equals("")) {
                        paramOffenceSection += "(" + tempOCNT_SUB_SCTN_ID + ")";
                    }
                    if (null != tempOCNT_PARA_ID && !tempOCNT_PARA_ID.equals("")) {
                        paramOffenceSection += "(" + tempOCNT_PARA_ID + ")";
                    }
                    if (null != tempOCNT_OFNC_CLAS_ID && !tempOCNT_OFNC_CLAS_ID.equals("")) {
                        paramOffenceSection += "(" + tempOCNT_OFNC_CLAS_ID + ")";
                    }

                    //clean up for reuse
                    if (null != preparedStatement) {
                        preparedStatement.close();
                        preparedStatement = null;
                    }
                    if (null != resultSet) {
                        resultSet.close();
                        resultSet = null;
                    }

                    selectSql = "SELECT " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                            + dbLetterPrefix + "FCS_CRT_OFC AS OFCS_CRT_OFC, " + " " + ICON_SCHEMA_NAME + ".ICOS"
                            + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_JRSDCTN_NUM AS OFCS_JRSDCTN_NUM, "
                            + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                            + "FCS_INFO_YY AS OFCS_INFO_YY, " + " " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix
                            + "FCS." + dbLetterPrefix + "FCS_INFO_PREFIX AS OFCS_INFO_PREFIX, " + " "
                            + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                            + "FCS_INFO_SUFFIX AS OFCS_INFO_SUFFIX, " + " " + ICON_SCHEMA_NAME
                            + ".ICOSARRT.ARRT_TTL_FINE_AMT,   " + " " + ICON_SCHEMA_NAME
                            + ".ICOSARRT.ARRT_PRE_PD_FINE_TTL_AMT, " + " " + ICON_SCHEMA_NAME
                            + ".ICOSARRT.ARRT_PRE_PD_COST_TTL_AMT " + "FROM  " + " " + ICON_SCHEMA_NAME + ".ICOS"
                            + dbLetterPrefix + "FCS " + "INNER JOIN " + " " + ICON_SCHEMA_NAME + ".ICOSARRT "
                            + " ON " + " ( " + "     " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                            + dbLetterPrefix + "FCS_CRT_OFC = " + ICON_SCHEMA_NAME + ".ICOSARRT.ARRT_CRT_OFC"
                            + " ) " + " AND " + " ( " + "     " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix
                            + "FCS." + dbLetterPrefix + "FCS_JRSDCTN_NUM = " + ICON_SCHEMA_NAME
                            + ".ICOSARRT.ARRT_JRSDCTN_NUM " + " ) " + " AND " + " ( " + "     " + ICON_SCHEMA_NAME
                            + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_YY = "
                            + ICON_SCHEMA_NAME + ".ICOSARRT.ARRT_INFO_YY " + " ) " + " AND " + " ( " + "     "
                            + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                            + "FCS_INFO_PREFIX = " + ICON_SCHEMA_NAME + ".ICOSARRT.ARRT_INFO_PREFIX " + " ) "
                            + " AND " + " ( " + "     " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS."
                            + dbLetterPrefix + "FCS_INFO_SUFFIX = " + ICON_SCHEMA_NAME
                            + ".ICOSARRT.ARRT_INFO_SUFFIX " + " ) " + "WHERE  " + " " + ICON_SCHEMA_NAME + ".ICOS"
                            + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_CRT_OFC = '" + courtOfficeId + "' "
                            + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                            + "FCS_JRSDCTN_NUM = '" + jurisdictionNumber + "' " + " AND " + ICON_SCHEMA_NAME
                            + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_YY = '" + infoYear
                            + "' " + " AND " + ICON_SCHEMA_NAME + ".ICOS" + dbLetterPrefix + "FCS." + dbLetterPrefix
                            + "FCS_INFO_PREFIX = '" + infoPrefix + "' " + " AND " + ICON_SCHEMA_NAME + ".ICOS"
                            + dbLetterPrefix + "FCS." + dbLetterPrefix + "FCS_INFO_SUFFIX = '" + infoSuffix + "' ";

                    selectSql += " ";
                    logger.info("+++++SQL: " + selectSql);

                    preparedStatement = iicfConnection.prepareStatement(selectSql,
                            ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

                    resultSet = preparedStatement.executeQuery();

                    resultSet.last();
                    resultSetCount = resultSet.getRow();
                    logger.info("resultSetCount: " + resultSetCount);
                    resultSet.beforeFirst();

                    paramOffenceTotalPayable = "";
                    if (resultSetCount == 1) {
                        resultSet.next();
                        //                  if(null != resultSet.getString("ARRT_TTL_FINE_AMT")){
                        //                      NumberFormat formatUS = NumberFormat.getCurrencyInstance(Locale.US);
                        //                      //logger.info("formatUS: " + formatUS.format(resultSet.getDouble("ARRT_TTL_FINE_AMT")) );
                        //                      paramOffenceTotalPayable = formatUS.format(resultSet.getDouble("ARRT_TTL_FINE_AMT"));
                        //                   }
                        //ARRT_TTL_FINE_AMT, ARRT_PRE_PD_FINE_TTL_AMT, ARRT_PRE_PD_COST_TTL_AMT
                        BigDecimal totalPayable;
                        BigDecimal totalFineAmount = resultSet.getBigDecimal("ARRT_TTL_FINE_AMT");
                        BigDecimal totalPrePDFineAmount = resultSet.getBigDecimal("ARRT_PRE_PD_FINE_TTL_AMT");
                        BigDecimal totalPrePDCostAmount = resultSet.getBigDecimal("ARRT_PRE_PD_COST_TTL_AMT");
                        //these will never be null so NO need to check for null 

                        totalPayable = totalPrePDFineAmount.add(totalPrePDCostAmount);

                        //IF(ARRT_PRE_PD_FINE_TTL_AMT + ARRT_PRE_PD_COST_TTL_AMT < 0) THEN 
                        if (totalPayable.compareTo(new BigDecimal("0.0")) < 0) {
                            totalPayable = totalFineAmount;
                        }

                        NumberFormat formatUS = NumberFormat.getCurrencyInstance(Locale.US);
                        paramOffenceTotalPayable = formatUS.format(totalPayable.doubleValue());
                    }

                } // if(resultSetCount != 1)

            } catch (SQLException sqlException) {
                sqlException.printStackTrace();
            } catch (Exception e) {
                paramOffenceNumber = "";
                paramOffenceDate = "";
                paramOfficerNumber = "";
                paramDriversLicenseNumber = "";
                paramPlateNumber = "";
                paramEnforcementAgency = "";
                paramSex = "";
                paramDateOfBirth = "";
                paramCVOR = "";
                paramUnit = "";
                paramOffenderFullName = "";
                paramAddressLine1 = "";
                paramAddressLine2 = "";
                paramAddressLine3 = "";
                paramOffenceDay = "";
                paramOffenceMonth = "";
                paramOffenceYear = "";
                paramOffenceTime = "";
                paramOffenceLocation = "";
                paramOffenceDesc = "";
                paramOffenceStatue = "";
                paramOffenceSection = "";
                paramOffenceTotalPayable = "";
                paramInterpreterLanguage = "";

                e.printStackTrace();
            } finally {
                //             setDiscreteParameterValue(this, "paramOffenceNumber", "", paramOffenceNumber);
                //             setDiscreteParameterValue(this, "paramOffenceDate", "", paramOffenceDate);
                //             setDiscreteParameterValue(this, "paramOfficerNumber", "", paramOfficerNumber);
                //             setDiscreteParameterValue(this, "paramDriversLicenseNumber", "", paramDriversLicenseNumber);
                //             setDiscreteParameterValue(this, "paramPlateNumber", "", paramPlateNumber);
                //             setDiscreteParameterValue(this, "paramEnforcementAgency", "", paramEnforcementAgency);
                //             setDiscreteParameterValue(this, "paramSex", "", paramSex);
                //             setDiscreteParameterValue(this, "paramDateOfBirth", "", paramDateOfBirth);
                //             setDiscreteParameterValue(this, "paramCVOR", "", paramCVOR);
                //             setDiscreteParameterValue(this, "paramUnit", "", paramUnit);
                //             setDiscreteParameterValue(this, "paramOffenderFullName", "", paramOffenderFullName);
                //             setDiscreteParameterValue(this, "paramAddressLine1", "", paramAddressLine1);
                //             setDiscreteParameterValue(this, "paramAddressLine2", "", paramAddressLine2);
                //             setDiscreteParameterValue(this, "paramAddressLine3", "", paramAddressLine3);
                //             setDiscreteParameterValue(this, "paramOffenceDay", "", paramOffenceDay);
                //             setDiscreteParameterValue(this, "paramOffenceMonth", "", paramOffenceMonth);
                //             setDiscreteParameterValue(this, "paramOffenceYear", "", paramOffenceYear);
                //             setDiscreteParameterValue(this, "paramOffenceTime", "", paramOffenceTime);
                //             setDiscreteParameterValue(this, "paramOffenceLocation", "", paramOffenceLocation);
                //             setDiscreteParameterValue(this, "paramOffenceDesc", "", paramOffenceDesc);
                //             setDiscreteParameterValue(this, "paramOffenceStatue", "", paramOffenceStatue);
                //             setDiscreteParameterValue(this, "paramOffenceSection", "", paramOffenceSection);
                //             setDiscreteParameterValue(this, "paramOffenceTotalPayable", "", paramOffenceTotalPayable);
                //             setDiscreteParameterValue(this, "paramTrialDay", "", paramTrialDay);
                //             setDiscreteParameterValue(this, "parmaTrialMonth", "", parmaTrialMonth);
                //             setDiscreteParameterValue(this, "paramTrailYear", "", paramTrailYear);
                //             setDiscreteParameterValue(this, "paramTrailTimeHour", "", paramTrailTimeHour);
                //             setDiscreteParameterValue(this, "paramTrailLocation", "", paramTrailLocationCourtOfficeId);
                //             setDiscreteParameterValue(this, "paramIssuedAt", "", paramIssuedAt);
                //             setDiscreteParameterValue(this, "paramIssuedDay", "", paramIssuedDay);
                //             setDiscreteParameterValue(this, "paramIssuedMonth", "", paramIssuedMonth);
                //             setDiscreteParameterValue(this, "paramIssuedYear", "", paramIssuedYear);
                //            //Modified Oct 17, 2007
                //            setDiscreteParameterValue(this, "paramFormNumberLabel", "", paramFormNumberLabel);

                try {
                    if (null != preparedStatement) {
                        preparedStatement.close();
                        preparedStatement = null;
                    }
                    if (null != iicfConnection) {
                        iicfConnection.close();
                        iicfConnection = null;
                    }
                } catch (SQLException e1) {
                }

            } //try
        } //if(null != iicfConnection && true == isOffenceNumberValid())
    }

    private boolean isOffenceNumberValid() {
        boolean isOffenceNumberValid = true;

        if (null == courtOfficeId || courtOfficeId.equals(""))
            isOffenceNumberValid = false;
        if (null == jurisdictionNumber || jurisdictionNumber.equals(""))
            isOffenceNumberValid = false;
        if (null == infoYear || infoYear.equals(""))
            isOffenceNumberValid = false;
        if (null == infoPrefix || infoPrefix.equals(""))
            isOffenceNumberValid = false;
        if (null == infoSuffix || infoSuffix.equals(""))
            isOffenceNumberValid = false;

        return isOffenceNumberValid;
    }

    /** 
     * OFCS_ADDR_ST 
     */
    public String getAddressLine1() {
        return paramAddressLine1;
    }

    /** 
     * OFCS_ADDR_CTY + OFCS_ADDR_PROV
     */
    public String getAddressLine2() {
        return paramAddressLine2;
    }

    /** 
     * OFCS_ADDR_PSTL_CD
     */
    public String getAddressLine3() {
        return paramAddressLine3;
    }

    /** 
     * OCNT_CVOR_NUM
     */
    public String getCVOR() {
        return paramCVOR;
    }

    /** 
     * OFCS_DRVR_LIC_PART_1+OFCS_DRVR_LIC_PART_2+OFCS_DRVR_LIC_PART_3
     */
    public String getDriversLicenseNumber() {
        return paramDriversLicenseNumber;
    }

    /** 
     * OFCS_ENF_AGCY
     */
    public String getEnforcementAgency() {
        return paramEnforcementAgency;
    }

    /** 
     * OCNT_OFNC_DT With Slashes in Format DD/MM/YYYY
     */
    public String getOffenceDate() {
        return paramOffenceDate;
    }

    /**
     * OCNT_OFNC_DT With Slashes in Format DD/MM/YY
     */
    public String getOffenceDateShortFormat() {
        String tempDate = "";
        String retVal = getOffenceDate(); //DD/MM/YYYY

        if (null != retVal && retVal.length() > 8) {
            tempDate = retVal.substring(0, 6); //get DD/MM/
            tempDate += retVal.substring(8, 10); //get YY at the end
        }
        retVal = tempDate; //retVal now DD/MM/YY OR ""

        //return paramOffenceDate;
        return retVal;
    }

    /** 
     * str Offence Day
     */
    public String getOffenceDay() {
        return paramOffenceDay;
    }

    /** 
     * Offence Desc in EN or FR
     */
    public String getOffenceDesc() {
        return paramOffenceDesc;
    }

    /** 
     * OCNT_LOCN_DESC
     */
    public String getOffenceLocation() {
        return paramOffenceLocation;
    }

    /** 
     * str Offence Month
     */
    public String getOffenceMonth() {
        return paramOffenceMonth;
    }

    /** 
     * OFCS_CRT_OFC + OFCS_JRSDCTN_NUM + OFCS_INFO_YY + OFCS_INFO_PREFIX + OFCS_INFO_SUFFIX
     */
    public String getOffenceNumber() {
        return paramOffenceNumber;
    }

    /** 
     * OCNT_SCTN_ID + OCNT_SUB_SCTN_ID + OCNT_PARA_ID + OCNT_OFNC_CLAS_ID
     */
    public String getOffenceSection() {
        return paramOffenceSection;
    }

    /** 
     * Offence Statue Desc
     */
    public String getOffenceStatue() {
        return paramOffenceStatue;
    }

    /** 
     * Offence Time Formated in EN or FR 
     */
    public String getOffenceTime() {
        return paramOffenceTime;
    }

    /** 
     * Offence Total Payable <br>
     * ARRT_PRE_PD_FINE_TTL_AMT + ARRT_PRE_PD_COST_TTL_AMT
     */
    public String getOffenceTotalPayable() {
        return paramOffenceTotalPayable;
    }

    /** 
     * str Offence Year
     */
    public String getOffenceYear() {
        return paramOffenceYear;
    }

    /** 
     * OFCS_GVN_NM + OFCS_INIT + OFCS_SRNM
     */
    public String getOffenderFullName() {
        return paramOffenderFullName;
    }

    /** 
     * OFCS_OFCR_BDG_NUM
     */
    public String getOfficerNumber() {
        return paramOfficerNumber;
    }

    /** 
     * OFCS_LIC_PLATE_NUM
     */
    public String getPlateNumber() {
        return paramPlateNumber;
    }

    /** 
     * OFCS_SEX_CD
     */
    public String getSex() {
        return paramSex;
    }

    /** 
     * OFCS_ENF_AGCY_DIV_CD
     */
    public String getUnit() {
        return paramUnit;
    }

    /**
     * OFCS_BRTH_DT With Slashes in Format DD/MM/YYYY
     */
    public String getDateOfBirth() {
        return paramDateOfBirth;
    }

    /**
     * OFCS_BRTH_DT With Slashes in Format DD/MM/YY
     */
    public String getDateOfBirthShortFormat() {
        String tempDate = "";
        String retVal = getDateOfBirth(); //DD/MM/YYYY

        if (null != retVal && retVal.length() > 8) {
            tempDate = retVal.substring(0, 6); //get DD/MM/
            tempDate += retVal.substring(8, 10); //get YY at the end
        }
        retVal = tempDate; //retVal now DD/MM/YY OR ""

        //return paramDateOfBirth;
        return retVal;
    }

    /**
     * OFCS_INTERP_LANG_CD
     */
    public String getInterpreterLanguage() {
        return paramInterpreterLanguage;
    }

    public boolean isRunAsStandAlone() {
        return runAsStandAlone;
    }

    public void setRunAsStandAlone(boolean runAsStandAlone) {
        this.runAsStandAlone = runAsStandAlone;
    }

    public boolean isEnglish() {
        return isEnglish;
    }

    public String getReturnMessage() {
        return returnMessage;
    }

    public void setReturnMessage(String returnMessage) {
        this.returnMessage = returnMessage;
    }

    public String getTrailLocationCourtId() {
        return paramTrailLocationCourtId;
    }

    public void setTrailLocationCourtId(String paramTrailLocationCourtId) {
        this.paramTrailLocationCourtId = paramTrailLocationCourtId;
    }

    public String getTrailRoom() {
        return paramTrailRoom;
    }

    public void setTrailRoom(String paramTrailRoom) {
        this.paramTrailRoom = paramTrailRoom;
    }

    public String getTrailYear() {
        return paramTrailYear;
    }

    public void setTrailYear(String paramTrailYear) {
        this.paramTrailYear = paramTrailYear;
    }

    public String getTrialDay() {
        return paramTrialDay;
    }

    public void setTrialDay(String paramTrialDay) {
        this.paramTrialDay = paramTrialDay;
    }

    public String getTrialMonth() {
        return paramTrialMonth;
    }

    public void setTrialMonth(String paramTrialMonth) {
        this.paramTrialMonth = paramTrialMonth;
    }

    public String getTrailTimeHour() {
        return paramTrailTimeHour;
    }

    public void setTrailTimeHour(String paramTrailTimeHour) {
        this.paramTrailTimeHour = paramTrailTimeHour;
    }

    public String getTrailTimeMinute() {
        return paramTrailTimeMinute;
    }

    public void setTrailTimeMinute(String paramTrailTimeMinute) {
        this.paramTrailTimeMinute = paramTrailTimeMinute;
    }

    public String getSentenceDateDay() {
        return paramSentenceDateDay;
    }

    public String getSentenceDateMonth() {
        return paramSentenceDateMonth;
    }

    public String getSentenceDateYear() {
        return paramSentenceDateYear;
    }

    public String getAppearanceType() {
        return paramAppearanceType;
    }

    public void setAppearanceType(String appearanceType) {
        this.paramAppearanceType = appearanceType;
    }
}