[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ResultSet.updateXXX not supported, what to do instead?
Aaron Westendorf wrote:
> Tomasz Sztejka wrote:
>
>> 1. How do I detect, if method is supported or not? Is there a method
>> which I may querry and check, if updateXXX is supported? Asking
>> ResultSet for its ResultSetMetaData.isWritable returns true for every
>> column, what suggests update should work
>
> You can retrieve the DatabaseMetaData from your Connection, and through
> this discover many properties of the database and the engine. Calling
> method 'supportsResultSetType(int)' with the argument
> ResultSet.CONCUR_UPDATABLE might give you the response you're looking
> for. Sounds like you may have found a bug though; I'm not using 1.4 in
> my development, so I can't verify your findings.
It's not clear from the JDBC specification if the
ResultSetMetaData.isWritable method should be used to indicate if the
column is updatable (through an updatable ResultSet). It could indicate
if the user is permitted to update or insert to the column through the
standard SQL interface. Since the 'isWritable' method was available in
JDBC 1.0 (before updateable result sets) I suspect this is the intent.
Toby.