public int getInt(int columnIndex) throws SQLException {
        Object value;

        // sanity check.
        checkIndex(columnIndex);
        // make sure the cursor is on a valid row
        checkCursor();

        setLastValueNull(false);
        value = getCurrentRow().getColumnObject(columnIndex);

        // check for SQL NULL
        if (value == null) {
            setLastValueNull(true);
            return 0;
        }

        try {
            return ((Integer.valueOf(value.toString().trim())).intValue());
        } catch (NumberFormatException ex) {
            throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.intfail").toString(),
                  new Object[] {value.toString().trim(), columnIndex}));
        }
    }
Retrieves the value of the designated column in the current row
of this <code>CachedRowSetImpl</code> object as an
<code>int</code> value.

@param columnIndex the first column is <code>1</code>, the second
       is <code>2</code>, and so on; must be <code>1</code> or larger
       and equal to or less than the number of columns in the rowset
@return the column value; if the value is SQL <code>NULL</code>, the
        result is <code>0</code>
@throws SQLException if (1) the given column index is out of bounds,
(2) the cursor is not on one of this rowset's rows or its
insert row, or (3) the designated column does not store an
SQL <code>TINYINT, SMALLINT, <b>INTEGER</b>, BIGINT, REAL
FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, CHAR, VARCHAR</code>
or <code>LONGVARCHAR</code> value. The bold SQL type designates the
recommended return type.
src/main/java/org/replicadb/rowset/sun/rowset/CachedRowSetImpl.java