Oliver Jowett pisze:
> I was wondering which behaviour was right -- I thought returning
> array-of-primitive was correct per the spec at the time I wrote it, and
> that's why getArray() returns Object not Object[] -- but now the 1.6
> javadoc says:
>
>> Note: When getArray is used to materialize a base type that maps to a
>> primitive data type, then it is implementation-defined whether the
>> array returned is an array of that primitive data type or an array of
>> Object.
>
> So I suppose that .. in theory .. applications should be expecting to
> handle both. Ugh.
My opinion is that we should keep BC either by building two different
jdbc versions or checking PG version every time getArray() is used (if <
8.2 then primitive types are used, if >= 8.2 then objects). Second
option is quite good, although it doesn't guaranty full BC - let assume
that someone is using jdbc application that was written for pg 8.0, but
after update to 8.2 the code with following statement:
<code>(boolean[]) getArray()</code>
would cause cast exception (Cannot cast from Boolean[] to boolean[]).
Regards,
ML