Re: setObject on PGInterval throws "Unknown Type null"

Поиск
Список
Период
Сортировка
От Jean-Pierre Pelletier
Тема Re: setObject on PGInterval throws "Unknown Type null"
Дата
Msg-id BAYC1-PASMTP034FB41F0D2750919A332895870@cez.ice
обсуждение исходный текст
Ответ на setObject on PGInterval throws "Unknown Type null"  ("Jean-Pierre Pelletier" <pelletier_32@sympatico.ca>)
Ответы Re: setObject on PGInterval throws "Unknown Type null"
Список pgsql-jdbc
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)


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: setObject on PGInterval throws "Unknown Type null"
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: setObject on PGInterval throws "Unknown Type null"