public BigDecimal getBigDecimal() { return convertTo(Value.DECIMAL).getBigDecimal(); }
/** * Returns the value of the specified column as a BigDecimal. * * @param columnLabel the column label * @return the value * @throws SQLException if the column is not found or if the result set is * closed */ @Override public BigDecimal getBigDecimal(String columnLabel) throws SQLException { try { debugCodeCall("getBigDecimal", columnLabel); return get(columnLabel).getBigDecimal(); } catch (Exception e) { throw logAndConvert(e); } }
/** * Returns the value of the specified column as a BigDecimal. * * @param columnIndex (1,2,...) * @return the value * @throws SQLException if the column is not found or if the result set is * closed */ @Override public BigDecimal getBigDecimal(int columnIndex) throws SQLException { try { debugCodeCall("getBigDecimal", columnIndex); return get(columnIndex).getBigDecimal(); } catch (Exception e) { throw logAndConvert(e); } }
/** * Returns the value of the specified column as a BigDecimal. * * @param columnIndex (1,2,...) * @param scale the scale of the returned value * @return the value * @throws SQLException if the column is not found or if the result set is * closed * @deprecated use {@link #getBigDecimal(int)} */ @Override public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { try { if (isDebugEnabled()) { debugCode("getBigDecimal(" + columnIndex + ", " + scale + ");"); } if (scale < 0) { throw DbException.getInvalidValueException("scale", scale); } BigDecimal bd = get(columnIndex).getBigDecimal(); return bd == null ? null : ValueDecimal.setScale(bd, scale); } catch (Exception e) { throw logAndConvert(e); } }
/** * Returns the value of the specified column as a BigDecimal. * * @param columnLabel the column label * @param scale the scale of the returned value * @return the value * @throws SQLException if the column is not found or if the result set is * closed * @deprecated use {@link #getBigDecimal(String)} */ @Override public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { try { if (isDebugEnabled()) { debugCode("getBigDecimal(" + StringUtils.quoteJavaString(columnLabel) + ", " + scale + ");"); } if (scale < 0) { throw DbException.getInvalidValueException("scale", scale); } BigDecimal bd = get(columnLabel).getBigDecimal(); return bd == null ? null : ValueDecimal.setScale(bd, scale); } catch (Exception e) { throw logAndConvert(e); } }
return ValueByte.get(convertToByte(getLong())); case DECIMAL: return ValueByte.get(convertToByte(convertToLong(getBigDecimal()))); case DOUBLE: return ValueByte.get(convertToByte(convertToLong(getDouble()))); return ValueShort.get(convertToShort(getLong())); case DECIMAL: return ValueShort.get(convertToShort(convertToLong(getBigDecimal()))); case DOUBLE: return ValueShort.get(convertToShort(convertToLong(getDouble()))); return ValueInt.get(convertToInt(getLong())); case DECIMAL: return ValueInt.get(convertToInt(convertToLong(getBigDecimal()))); case DOUBLE: return ValueInt.get(convertToInt(convertToLong(getDouble()))); return ValueLong.get(getInt()); case DECIMAL: return ValueLong.get(convertToLong(getBigDecimal())); case DOUBLE: return ValueLong.get(convertToLong(getDouble())); return ValueDouble.get(getLong()); case DECIMAL: return ValueDouble.get(getBigDecimal().doubleValue()); case FLOAT: return ValueDouble.get(getFloat());
r.getValue(session).getBigDecimal() .compareTo(ValueLong.MIN_BD) == 0) {
case Value.DOUBLE: case Value.FLOAT: result = ValueString.get(toChar(v0.getBigDecimal(), v1 == null ? null : v1.getString(), v2 == null ? null : v2.getString()),