field.sqldata = new Long(value.unscaledValue().longValue());
field.sqldata = XSQLVAR.encodeLong(value.unscaledValue().shortValue());
    void setBigDecimal(BigDecimal value) throws SQLException {        value = value.setScale(-field.sqlscale, BigDecimal.ROUND_HALF_UP);        if (fieldType == 1) {            // check if value is withing bounds            if (value.unscaledValue().compareTo(MAX_SHORT) > 0 ||                value.unscaledValue().compareTo(MIN_SHORT) < 0)                    throw (SQLException)createException(                        BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();            field.sqldata = new Short(value.unscaledValue().shortValue());        } else        if (fieldType == 2) {            // check if value is withing bounds            if (value.unscaledValue().compareTo(MAX_INT) > 0 ||                value.unscaledValue().compareTo(MIN_INT) < 0)                    throw (SQLException)createException(                        BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();            field.sqldata = new Integer(value.unscaledValue().intValue());        } else        if (fieldType == 3) {                        // check if value is withing bounds            if (value.unscaledValue().compareTo(MAX_LONG) > 0 ||                value.unscaledValue().compareTo(MIN_LONG) < 0)                    throw (SQLException)createException(                        BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();                        field.sqldata = new Long(value.unscaledValue().longValue());        } else            throw (SQLException)createException(                BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();    }