db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fischer (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-142) ResultSetMetaData.isReadOnly() also returns wrong results
Date Wed, 12 Oct 2005 07:44:25 GMT
    [ http://issues.apache.org/jira/browse/DERBY-142?page=comments#action_12331866 ] 

Thomas Fischer commented on DERBY-142:

The description Jean gave above of how village works is correct. 

Regarding the question how to interpret the term "designated column", all the databases Torque
is working with (I can confirm this personally for mysql, postgresql, oracle, firebird, hsqldb,
others report that db2, sybase... are also working) either interpret this as "the table of
the underlying column", or produce updateable result sets without adding the "for update"
clause. Village using the following code:

String sql = "SELECT " + columnsAttribute + " FROM " + tableName + " WHERE 1 = -1";
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);

>From the java API spec:

public Statement createStatement() throws SQLException
Creates a Statement object for sending SQL statements to the database. ....  Result sets created
using the returned Statement object will by default be type TYPE_FORWARD_ONLY and have a concurrency

So I would suspect that most of the databases will not return an updateable result set upon
execution of the code above (because the concurrency level is explitly set to CONCUR_READ_ONLY),
though I know it only for oracle for sure (oracle also uses the "for update" clause). Thus,
most of the other database vendors interpret the term "designated column" as "the table of
the underlying column".

> 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