Package org.apache.derby.iapi.types

Examples of org.apache.derby.iapi.types.SQLDecimal


            return TypeId.SMALLINT_PRECISION;
        case Types.BIGINT:
            return TypeId.LONGINT_PRECISION;
        case Types.DECIMAL:
            if (val != null) {
                SQLDecimal constantDecimal = new SQLDecimal((BigDecimal) val);
                return constantDecimal.getDecimalValuePrecision();
            } else {
                return TypeId.DECIMAL_PRECISION;
            }
        case Types.DOUBLE:
            return TypeId.DOUBLE_PRECISION;
View Full Code Here


            return TypeId.SMALLINT_SCALE;
        case Types.BIGINT:
            return TypeId.LONGINT_SCALE;
        case Types.DECIMAL:
            if (val != null) {
                SQLDecimal constantDecimal = new SQLDecimal((BigDecimal) val);
                return constantDecimal.getDecimalValueScale();
            } else {
                return TypeId.DECIMAL_SCALE;
            }
        case Types.DOUBLE:
            return TypeId.DOUBLE_SCALE;
View Full Code Here

           return val != null ? TypeId.SMALLINT_MAXWIDTH : 0;
       case Types.BIGINT:
           return val != null ? TypeId.LONGINT_MAXWIDTH: 0;
       case Types.DECIMAL:
            if (val != null) {
               SQLDecimal constantDecimal = new SQLDecimal((BigDecimal) val);
               int precision = constantDecimal.getDecimalValuePrecision();
               int scal = constantDecimal.getDecimalValueScale();
               /* be consistent with our convention on maxwidth, see also
                * exactNumericType(), otherwise we get format problem, b 3923
                */
               return DataTypeUtilities.computeMaxWidth(precision, scal);
            } else {
View Full Code Here

            break;
       case Types.BIGINT:
           setValue(new SQLLongint((Long)value));
            break;
       case Types.DECIMAL:
           setValue(new SQLDecimal((BigDecimal)value));
            break;
       case Types.DOUBLE:
           setValue(new SQLDouble((Double)value));
            break;
       case Types.REAL:
View Full Code Here

           typeName.equals(TypeId.SMALLINT_NAME)) {
      newValue = new org.apache.derby.iapi.types.SQLInteger();
    } else if (typeName.equals(TypeId.REAL_NAME)) {
      newValue = new org.apache.derby.iapi.types.SQLDouble();
    } else {
            newValue = new SQLDecimal();
    }
   
    newValue.setValue(value);
    value = newValue;
   
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.types.SQLDecimal

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.