public java.sql.Date getDate(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 null;
        }

        /*
         * The object coming back from the db could be
         * a date, a timestamp, or a char field variety.
         * If it's a date type return it, a timestamp
         * we turn into a long and then into a date,
         * char strings we try to parse. Yuck.
         */
        switch (RowSetMD.getColumnType(columnIndex)) {
            case Types.DATE: {
                long sec = ((java.sql.Date)value).getTime();
                return new java.sql.Date(sec);
            }
            case Types.TIMESTAMP: {
                long sec = ((Timestamp)value).getTime();
                return new java.sql.Date(sec);
            }
            case Types.CHAR:
            case Types.VARCHAR:
            case Types.LONGVARCHAR: {
                try {
                    DateFormat df = DateFormat.getDateInstance();
                    return ((java.sql.Date)(df.parse(value.toString())));
                } catch (ParseException ex) {
                    throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.datefail").toString(),
                        new Object[] {value.toString().trim(), columnIndex}));
                }
            }
            default: {
                throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.datefail").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 a
<code>java.sql.Date</code> object.

@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 as a <code>java.sql.Data</code> object; if
       the value is SQL <code>NULL</code>, the
       result is <code>null</code>
@throws SQLException if the given column index is out of bounds,
           the cursor is not on a valid row, or this method fails
src/main/java/org/replicadb/rowset/sun/rowset/CachedRowSetImpl.java