db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject ResultSetMetaData.isReadOnly who's right embedded or client
Date Thu, 08 Mar 2007 17:15:38 GMT
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