see attached
I've changed direction to an array, and cleaned up the test cases.
regarding the jdbc3 type conversion in registerOutParameter, an
existing conversion (BIT to BOOLEAN) was there, do all of them need
to be in jdbc2 ?
See my comments below.
On 29-Jun-05, at 6:24 PM, Oliver Jowett wrote:
> Dave Cramer wrote:
>
>
>>> You seem to have reverted your earlier changes and put back the
>>> types/* classes -- why?
>>>
>>
>> huh ? they should be in there in HEAD, I did remove the creation
>> of an
>> object, and went to static methods
>>
I moved them from to core/types, but they have always been there
>
> HEAD went through this progression:
>
> (1) no types/*
> (2) you added types/PGByte, etc
> (3) you removed types/* and added static methods
>
> Your patch does things like this:
>
>
>> --- 1500,1520 ----
>> preparedParameters.clear();
>> }
>>
>> ! private PGType createInternalType( Object x, int
>> targetType ) throws PSQLException
>> {
>> ! if ( x instanceof Byte ) return PGByte.castToServerType
>> ((Byte)x, targetType );
>> ! if ( x instanceof Short ) return PGShort.castToServerType
>> ((Short)x, targetType );
>> ! if ( x instanceof Integer ) return
>> PGInteger.castToServerType((Integer)x, targetType );
>> ! if ( x instanceof Long ) return PGLong.castToServerType
>> ((Long)x, targetType );
>> ! if ( x instanceof Double ) return
>> PGDouble.castToServerType((Double)x, targetType );
>> ! if ( x instanceof Float ) return PGFloat.castToServerType
>> ((Float)x, targetType );
>> ! if ( x instanceof BigDecimal) return
>> PGBigDecimal.castToServerType((BigDecimal)x, targetType );
>> ! // since all of the above are instances of Number make
>> sure this is after them
>> ! if ( x instanceof Number ) return
>> PGNumber.castToServerType((Number)x, targetType );
>> ! if ( x instanceof Boolean) return
>> PGBoolean.castToServerType((Boolean)x, targetType );
>> ! return new PGUnknown(x);
>>
>> + }
>> // Helper method for setting parameters to PGobject subclasses.
>> private void setPGobject(int parameterIndex, PGobject x)
>> throws SQLException {
>> String typename = x.getType();
>>
>
> which seems to be reverting back to step (2)
>
> I'm guessing you forgot to apply the changes in (3) to your working
> copy
> of the driver, then diffed against current HEAD..
>
> -O
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>
>