I interpret ResultSetMetaData to describe the ResultSet, not the base column of the table. If someone is interested in knowing whether a column of a table is readonly/definetely not writable, wouldn't they be using DatabaseMetaData or some other API to check that? I would expect ResultSetMetaData to describe the ResultSet itself, like Connection.isReadOnly() would indicate if a connection is readonly not if the database itself is readonly.

I agree this could be cleared in the spec. I looked at ODBC spec at Microsoft site. While there is no 1-1 matching between JDBC and ODBC, the following does this seem to favor my argument. Should we have a show of hands if this ODBC spec agrees with my argument or not? :-)

http://msdn.microsoft.com/library/default.asp?url="">

SQL_DESC_UPDATABLE
(ODBC 1.0)
Column is described by the values for the defined constants:

SQL_ATTR_READONLY
SQL_ATTR_WRITE
SQL_ATTR_READWRITE_UNKNOWN

SQL_DESC_UPDATABLE describes the updatability of the column in the result set, not the column in the base table. The updatability of the base column on which the result set column is based may be different from the value in this field. Whether a column is updatable can be based on the data type, user privileges, and the definition of the result set itself. If it is unclear whether a column is updatable, SQL_ATTR_READWRITE_UNKNOWN should be returned.


Satheesh

Daniel John Debrunner wrote:
Though of course, the spec could be cleared up, writable in what sense?
Through a positioned update/dml, through updateable result set, through
any DML statement? I think this method has been there since JDBC 1.1 so
that means it cannot mean just with respect to updateable result sets
since they were added in JDBC 2.0. Which probably means is the column
definitely not writable by any operation.

Dan.
  

Reply via email to