Package net.helipilot50.stocktrade.framework

Examples of net.helipilot50.stocktrade.framework.UsageException


    public DateTimeData getDateTimeData(String pColumnName) {
        try {
            // AD:22/07/2008 - Check if value is null and raise usage exception if it is
            Object o = resultSet.getObject(pColumnName);
            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getDateTimeData(String) could not handle column " + pColumnName + ". Result =" + o,
                        SP_ER_USER, SP_ER_PARAMETERERROR, UsageException.qq_Resolver.cMESSAGE_REASONCODE_SEVERITY);
            }
            DateTimeData dt = new DateTimeData(resultSet
                    .getTimestamp(pColumnName));
View Full Code Here


    public IntervalData getIntervalData(int pColumnID) {
        try {
            // AD:22/07/2008 - Check if value is null and raise usage exception if it is
            Object o = resultSet.getObject(pColumnID);
            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getIntervalData(int) could not handle column " + pColumnID + ". Result =" + o,
                        SP_ER_PARAMETERERROR, SP_ER_USER, UsageException.qq_Resolver.cMESSAGE_REASONCODE_SEVERITY);
            }
            IntervalData id = new IntervalData(resultSet.getString(pColumnID));
            return id;
View Full Code Here

    public IntervalData getIntervalData(String pColumnName) {
        try {
            // AD:22/07/2008 - Check if value is null and raise usage exception if it is
            Object o = resultSet.getObject(pColumnName);
            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getIntervalData(String) could not handle column " + pColumnName + ". Result =" + o,
                        SP_ER_PARAMETERERROR, SP_ER_USER, UsageException.qq_Resolver.cMESSAGE_REASONCODE_SEVERITY);
            }
            IntervalData id = new IntervalData(resultSet.getString(pColumnName));
            return id;
View Full Code Here

        Object o = null;
        try {
            o = resultSet.getObject(ColumnID);

            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getBoolean(int) could not handle column "
                                + ColumnID + ". Result =" + o);
            } else {
                return this.mapBooleanFromDB(o);
            }
View Full Code Here

        Object o = null;
        try {
            o = resultSet.getObject(ColumnName);

            if (o == null || resultSet.wasNull()) {
                throw new UsageException(
                        "getBoolean(String) could not handle column "
                                + ColumnName + ". Result =" + o);
            } else {
                return this.mapBooleanFromDB(o);
            }
View Full Code Here

     * like integer or string to the correct type
     * @param o
     */
    private boolean mapBooleanFromDB(Object o) {
        if (o == null) {
            UsageException errorVar = new UsageException("could not map null to a valid boolean");
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
        else if (o instanceof Boolean) {
            return ((Boolean)o).booleanValue();
        }
        else if (o instanceof String) {
            String s = (String)o;
            if (cTRUE.equalsIgnoreCase(s)) {
                return true;
            }
            else if (cFALSE.equalsIgnoreCase(s)) {
                return false;
            }
            else if (cYES.equalsIgnoreCase(s)) {
                return true;
            }
            else if (cNO.equalsIgnoreCase(s)) {
                return false;
            }
            else {
                return Boolean.valueOf(s).booleanValue();
            }
        }
        else if (o instanceof Short) {
            return ((Short)o).intValue() != cFALSE_INT;
        }
        else if (o instanceof Integer) {
            return ((Integer)o).intValue() != cFALSE_INT;
        }
        else if (o instanceof BigDecimal) {
            return ((BigDecimal)o).intValue() != cFALSE_INT;
        }
        else {
            UsageException errorVar = new UsageException("Could not map object of type " + o.getClass() + " to boolean");
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
    }
View Full Code Here

    ResultSet getResultSet() {
      return this.resultSet;
    }
   
    private RuntimeException processException(Exception e) {
        UsageException errorVar = new UsageException(e.getMessage(), SP_ER_USER, SP_ER_PARAMETERERROR, e);
        ErrorMgr.addError(errorVar);
        throw errorVar;
    }
View Full Code Here

        UsageException errorVar = new UsageException(e.getMessage(), SP_ER_USER, SP_ER_PARAMETERERROR, e);
        ErrorMgr.addError(errorVar);
        throw errorVar;
    }
    private RuntimeException processException(String message, Exception e) {
        UsageException errorVar = new UsageException(message, SP_ER_USER, SP_ER_PARAMETERERROR, e);
        ErrorMgr.addError(errorVar);
        throw errorVar;
    }
View Full Code Here

  private final Class<?> arrayType;
 
  public ArrayRowMapper(List<?> resultCollection, Class<?> arrayType) {
    Class<?> objectType = FrameworkUtils.getArrayType(arrayType);
    if (objectType == null) {
      UsageException ue = new UsageException("ArrayType " + arrayType.getName() + " cannot be used to determine the element type");
      ErrorMgr.addError(ue);
      throw ue;
    }
    this.arrayType = arrayType;
    this.mapper = new BeanRowMapper(objectType);
View Full Code Here

  }

  public ArrayRowMapper(List<?> resultCollection, Class<?> arrayType, RowMapper rowMapper) {
    Class<?> objectType = FrameworkUtils.getArrayType(arrayType);
    if (objectType == null) {
      UsageException ue = new UsageException("ArrayType " + arrayType.getName() + " cannot be used to determine the element type");
      ErrorMgr.addError(ue);
      throw ue;
    }
    this.arrayType = arrayType;
    this.mapper = rowMapper;
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.UsageException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.