new method names such as setInterval would be fine with me,
as I don't mind changing my code.
It doesn't fix the general case, but at least if fixes PGInterval which is
an improvement.
The advantage of overloaded versions of setObject over new method names was
to
provide backward compatibility for setObject(i,x)
i.e. no need to recode setObject(i,x) to setObject(i,x,Types.someType)
because setObject(i,x) is now broken with null objects.
I don't know how important is backward compatibility, that's your call.
Jean-Pierre Pelletier
----- Original Message -----
From: "Oliver Jowett" <oliver@opencloud.com>
To: "Jean-Pierre Pelletier" <pelletier_32@sympatico.ca>
Cc: "Kris Jurka" <books@ejurka.com>; <pgsql-jdbc@postgresql.org>
Sent: Wednesday, January 26, 2005 2:47 PM
Subject: Re: [JDBC] setObject on PGInterval throws "Unknown Type null"
> Jean-Pierre Pelletier wrote:
>
>> public void setObject(int parameterIndex, PGInterval x)
>> throws SQLException
>
> Overloading setObject() sounds very risky. How about this instead:
>
> public void setInterval(int parameterIndex, PGInterval x)
> throws SQLException
>
> That said, this doesn't help the general case as we can't know the set of
> extension types ahead of time.
>
>> public void setObject(int parameterIndex, Integer x)
>> throws SQLException
>
>> public void setObject(int parameterIndex, String x)
>> throws SQLException
>
> I don't see the benefit of these methods; they're just a nonstandard way
> of doing things that standard JDBC already lets you do (the second one
> especially -- it's identical to PreparedStatement.setString())
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)