db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satheesh Bandaram (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-142) ResultSetMetaData.isReadOnly() also returns wrong results
Date Tue, 11 Oct 2005 20:50:09 GMT
    [ http://issues.apache.org/jira/browse/DERBY-142?page=comments#action_12331838 ] 

Satheesh Bandaram commented on DERBY-142:

There is a question about whether isReadOnly() should return read-only (or definitely not
writable) value for the resultSet column returned or for the base table column. Since a ResultSetMetaData
should describe the ResultSet itself, not the base table, I think both Derby Client and embedded
drivers should return FALSE, for the following:

            connection = DriverManager.getConnection(URL, USER, PASSWORD);
            statement = connection.createStatement();
            resultset = statement.executeQuery(
                    "select id,name from " 
                    + TABLE);
            ResultSetMetaData metaData = resultset.getMetaData();
            System.out.println("ID column is: ' metaData.isReadOnly(1));
            System.out.println("Name column is: '+metaData.isReadOnly(2));

For this case, the resultset is forward-only read-only resultset. So, it seems isReadOnly()
should return TRUE. Embedded driver doesn't, so I think we should change embed driver to match
Derby Client here.

However, if resultset is retrived as:

          resultset = statement.executeQuery(
                    "select id,name from " 
                    + TABLE + " FOR UPDATE");

Derby Client returns FALSE for isReadOnly(), which is correct.

> ResultSetMetaData.isReadOnly() also returns wrong results
> ---------------------------------------------------------
>          Key: DERBY-142
>          URL: http://issues.apache.org/jira/browse/DERBY-142
>      Project: Derby
>         Type: Sub-task
>   Components: JDBC
>     Versions:
>  Environment: Using DB2 universal driver with standalone derby server
>     Reporter: Thomas Fischer
>  Attachments: DerbyTest.java, DerbyTest142.java
> ResultSetMetaData.isReadOnly() always returns true, even when writing to the table is
> The JDBC 2.0 spec says: "ResultSetMetaData.isReadOnly() : Indicates whether the designated
column is definitely not writable.", so the method should return false for a table.
> I will attach a testcase for this behaviour.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message