public Object getObject(int columnIndex) throws  SQLException { if (row == null) { throw new SQLException("No row fetched"); } setWasNullColumnIndex(columnIndex); if (wasNull()) { return null; }  int sqltype = getXsqlvar(columnIndex).sqltype & ~1; int sqlscale = getXsqlvar(columnIndex).sqlscale;  if ((sqltype == GDS.SQL_TEXT) || (sqltype == GDS.SQL_VARYING)) { if (row[columnIndex - 1] instanceof String) { return row[columnIndex - 1]; } else { return new String((byte[])row[columnIndex - 1]); } } else if ((sqltype == GDS.SQL_INT64) || (sqlscale < 0)) { return BigDecimal.valueOf(((Number)row[columnIndex - 1]).longValue(), sqlscale * (-1)); } else if (sqltype == GDS.SQL_BLOB) { InputStream in = getBinaryStream(columnIndex); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { byte[] buffer = new byte[512]; int count; while ((count = in.read(buffer)) > 0) { out.write(buffer, 0, count); } } catch (java.io.IOException ex) { throw new SQLException("Blob I/O error"); } return out.toByteArray(); } else { return row[columnIndex - 1]; }
public Object getObject(int columnIndex) throws SQLException { return getField(columnIndex).getObject();
    public Object getObject(int columnIndex) throws  SQLException {        if (row == null) {            throw new SQLException("No row fetched");        }        setWasNullColumnIndex(columnIndex);        if (wasNull()) {            return null;        }        int sqltype = getXsqlvar(columnIndex).sqltype & ~1;        int sqlscale = getXsqlvar(columnIndex).sqlscale;        if ((sqltype == GDS.SQL_TEXT) || (sqltype == GDS.SQL_VARYING)) {            if (row[columnIndex - 1] instanceof String) {                return row[columnIndex - 1];            } else {                return new String((byte[])row[columnIndex - 1]);            }        } else if ((sqltype == GDS.SQL_INT64) || (sqlscale < 0)) {            return BigDecimal.valueOf(((Number)row[columnIndex - 1]).longValue(),                                                               sqlscale * (-1));        } else if (sqltype == GDS.SQL_BLOB) {            InputStream in = getBinaryStream(columnIndex);            ByteArrayOutputStream out = new ByteArrayOutputStream();            try {                byte[] buffer = new byte[512];                int count;                while ((count = in.read(buffer)) > 0) {                    out.write(buffer, 0, count);                }            } catch (java.io.IOException ex) {                throw new SQLException("Blob I/O error");            }            return out.toByteArray();        } else {            return row[columnIndex - 1];        }    }