db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance J. Andersen" <Lance.Ander...@Sun.COM>
Subject Re: ResultSetMetaData.isReadOnly who's right embedded or client
Date Thu, 08 Mar 2007 17:37:30 GMT
i would recommend returning false as this returned result is not tied to 
an updatable ResultSet but to whether you can definitively determine the 
column cannot be modified.  This is a JDBC 1.0 method.

Regards
Lance

Kathey Marsden wrote:
> Client and embedded differ for isReadOnly.  The javadoc explains it as:
>
> "Indicates whether the designated column is definitely not writable."
>
>
> Embedded always returns false and indicates that this is refering to 
> the base table column:
> public final boolean isReadOnly(int column) throws SQLException {
>        validColumnNumber(column);
>
>        // we just don't know if it is a base table column or not
>        return false;
>    }
>
>
> Client returns whether the resultset is updateable or not:
>
>    public boolean isReadOnly(int column) throws SQLException {
>        try
>        {
>            checkForClosedStatement();
>            checkForValidColumnIndex(column);
>            if (sqlxUpdatable_ == null) {
>                return (resultSetConcurrency_ == 
> java.sql.ResultSet.CONCUR_READ_ONLY); // If no extended describe, 
> return resultSet's concurrecnty
>            }
>            return sqlxUpdatable_[column - 1] == 0; // PROTOCOL 0 means 
> not updatable, 1 means updatable
>        }
>        catch ( SqlException e )
>        {
>            throw e.getSQLException();
>        }
>    }
>
>
> Which is right here?
>
> Kathey
>

Mime
View raw message