Re: jdbc cts final diff for review - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: jdbc cts final diff for review
Date
Msg-id 82606823-092A-4BFE-89C4-8ADCA730AC70@fastcrypt.com
Whole thread Raw
In response to Re: jdbc cts final diff for review  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: jdbc cts final diff for review  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
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
>
>


Attachment

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: XA support
Next
From: Oliver Jowett
Date:
Subject: Re: jdbc cts final diff for review