> Hi. There's nothing wrong with your JDBC. It seems the
> driver is silently downgrading your ResultSet to a
> non updateable one. Check the driver documents about this.
> Joe Weinstein at BEA Systems
> If that's what's happening, the driver's not only being silent but
> devious. I tested the result set after it was created:
[quoted text clipped - 8 lines]
> I'm curious how you arrived at your conclusion. Are you aware of a
> DB2-specific issue? If so, could you reference any documentation?
Hi. I just based my conclusion on the obvious driver response
to the initial code. I would suggest making a small standalone
program that makes a JDBC connection, creates a table, inserts
a row, and then tries your code to update it via a result set.
Joe
> > Hi. There's nothing wrong with your JDBC. It seems the
> > driver is silently downgrading your ResultSet to a
> > non updateable one. Check the driver documents about this.
> > Joe Weinstein at BEA Systems
adamcrume@gmail.com - 29 Jun 2006 19:54 GMT
I changed CONCUR_UPDATABLE to CONCUR_READ_ONLY in my code, and the
error changed from "Column not updatable" to "ResultSet not updatable,"
so I'm fairly certain that the problem is not that the result set
itself is not updatable.
> Hi. I just based my conclusion on the obvious driver response
> to the initial code. I would suggest making a small standalone
> program that makes a JDBC connection, creates a table, inserts
> a row, and then tries your code to update it via a result set.
> Joe
joeNOSPAM@BEA.com - 29 Jun 2006 20:36 GMT
> I changed CONCUR_UPDATABLE to CONCUR_READ_ONLY in my code, and the
> error changed from "Column not updatable" to "ResultSet not updatable,"
> so I'm fairly certain that the problem is not that the result set
> itself is not updatable.
Good test. This means something in the metadata that
is sent from the DBMS with the query data is saying that,
and the driver is just reporting it.
Have you tried making the table with the JDBC code, so
we're all sure the current user has all relevant permissions
on the table?
Joe
adamcrume@gmail.com - 29 Jun 2006 21:08 GMT
I just talked to an IBM support rep. DB2 supports updatable cursors,
and the universal driver supports updatable result sets, but somehow
the two don't get along:
"Updatable scrollable cursor is supported against z/OS V7, however,
only JDBC 1 styled positioned update is supported, not the JDBC 2
styled updates via the updateXXX methods. This is because extended
describe is not supported on z/OS V7 which is needed for the driver to
retrieve the table name in order to build the update statement
internally."
(This page says the universal driver supports updatable result sets.)
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.
udb.doc/ad/rjvjcdif.htm
Positioned updates look rather strange, so I think I'll just go back to
a plain SELECT and UPDATE.
Thanks for your input.