value.setScale(-field.sqlscale);
value = value.setScale(-field.sqlscale, BigDecimal.ROUND_HALF_UP);
    void setBigDecimal(BigDecimal value) throws SQLException {        value.setScale(-field.sqlscale);        if (isType(field, Types.SMALLINT)) {            long longValue = value.unscaledValue().longValue();            // check if value is withing bounds            if (longValue > Short.MAX_VALUE ||                longValue < Short.MIN_VALUE)                    throw (SQLException)createException(                        BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();            field.sqldata = new Short((short)longValue);        } else        if (isType(field, Types.INTEGER)) {            long longValue = value.unscaledValue().longValue();            // check if value is withing bounds            if (longValue > Integer.MAX_VALUE ||                longValue < Integer.MIN_VALUE)                    throw (SQLException)createException(                        BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();            field.sqldata = new Integer((int)longValue);        } else        if (isType(field, Types.BIGINT)) {            field.sqldata = new Long(value.unscaledValue().longValue());        } else            throw (SQLException)createException(                BIGDECIMAL_CONVERSION_ERROR).fillInStackTrace();        setNull(false);    }