|
As i mentioned earlier, i will be addressing the lack of clarity in the
JDBC 4.0 spec, for the public draft (EDR2 just went to the JCP and
should be posted shortly)/ These metadata methods were added during the initial JDBC 1.0.2 release which was prior to updatable resultsets within jdbc. I am going to be discussing this in my weekly EG call this week. -lance Jean T. Anderson (JIRA) wrote: [ http://issues.apache.org/jira/browse/DERBY-142?page=comments#action_12331849 ]Jean T. Anderson commented on DERBY-142: ---------------------------------------- So Torque uses Village ( http://www.softwareforge.de/releases/village/ ) to insert/modify datasets. Here are a few more details about what Village does under the hood after a (very quick) look at it. (Torque lurkers should feel free to correct these details.) Village obtains the schema for a given table with this query: String sql = "SELECT " + columnsAttribute + " FROM " + tableName + " WHERE 1 = -1"; This query will work in any database, so this much makes sense. And it also makes sense to me that they wouldn't include a "FOR UPDATE" clause on it. At this point, they're just building internal information about the schema. Information for each column is then obtained with the ResultSetMetaData methods, including whether or not the column is writeable with that isReadOnly method call. The Village method that inserts a new row only does so if the columns are writeable. Hence the current problem. I'm looking at the jdbc docs at http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSetMetaData.html and I'm not seeing clearly whether these metadata calls are intended to just describe columns in the result set or columns in the underlying table: - isReadOnly: "Indicates whether the designated column is definitely not writable." - isWritable: "Indicates whether it is possible for a write on the designated column to succeed.". What is the "designated column"? Just the result set? Or could it also refer to the underlying table? I'm looking at the "JDBC API Tutorial and Reference, Third Edition", and section 27.1.19 on "Queries That Produce Updateable Result Sets" suggests to me a strong association with the permissions on the underlying table. --I'm left wondering what it might mean to update a result set outside the context of an underlying table. |
- Re: [jira] Commented: (DERBY-142) ResultSetMe... Lance J. Andersen
- Re: [jira] Commented: (DERBY-142) Result... Satheesh Bandaram
- Re: [jira] Commented: (DERBY-142) Re... Lance J. Andersen
- [jira] Commented: (DERBY-142) ResultSetM... Satheesh Bandaram (JIRA)
- [jira] Commented: (DERBY-142) ResultSetM... Daniel John Debrunner (JIRA)
- [jira] Commented: (DERBY-142) ResultSetM... Satheesh Bandaram (JIRA)
- [jira] Commented: (DERBY-142) ResultSetM... Satheesh Bandaram (JIRA)
- [jira] Commented: (DERBY-142) ResultSetM... Jean T. Anderson (JIRA)
- [jira] Commented: (DERBY-142) ResultSetM... Thomas Fischer (JIRA)
