@ Override public BigDecimal getBigDecimal ( int columnIndex ) throws SQLException { checkColumnBounds ( columnIndex ) ; try { final VoltType type = table . getColumnType ( columnIndex - 1 ) ; BigDecimal decimalValue = null ; switch ( type ) { case TINYINT : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case SMALLINT : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case INTEGER : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case BIGINT : decimalValue = new BigDecimal ( table . getLong ( columnIndex - 1 ) ) ; break ; case FLOAT : decimalValue = new BigDecimal ( table . getDouble ( columnIndex - 1 ) ) ; break ; case DECIMAL : decimalValue = table . getDecimalAsBigDecimal ( columnIndex - 1 ) ; break ; default : throw new IllegalArgumentException ( "Cannot get BigDecimal value for column type '" + type + "'" ) ; } return table . wasNull ( ) ? null : decimalValue ; } catch ( Exception x ) { throw SQLError . get ( x ) ; } }
ResultSet object as a java . math . BigDecimal with full precision .