From: Jean-Pierre Pelletier <pelletier_32@sympatico.ca>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setObject on PGInterval throws "Unknown Type null"
Date: Wed, 26 Jan 2005 16:03:08 -0500
Message-ID: <BAYC1-PASMTP034FB41F0D2750919A332895870@cez.ice> (raw)
References: <BAYC1-PASMTP01298C210325B348452D7995850@cez.ice>
<41F557C8.6030805@opencloud.com>
<BAYC1-PASMTP0179C8EF006D25C7EB161295860@cez.ice>
<41F6B5CE.3040107@opencloud.com>
<Pine.BSO.4.56.0501251726160.19087@leary.csoft.net>
<41F6D3EC.5000103@opencloud.com>
<Pine.BSO.4.56.0501251824160.15166@leary.csoft.net>
<41F6D733.7010702@opencloud.com>
<BAYC1-PASMTP0228507F4378F1CA76C8E995870@cez.ice>
<41F7F3D0.90809@opencloud.com>
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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pelletier_32@sympatico.ca, oliver@opencloud.com, books@ejurka.com
Subject: Re: setObject on PGInterval throws "Unknown Type null"
In-Reply-To: <BAYC1-PASMTP034FB41F0D2750919A332895870@cez.ice>
References: <BAYC1-PASMTP01298C210325B348452D7995850@cez.ice> <41F557C8.6030805@opencloud.com> <BAYC1-PASMTP0179C8EF006D25C7EB161295860@cez.ice> <41F6B5CE.3040107@opencloud.com> <Pine.BSO.4.56.0501251726160.19087@leary.csoft.net> <41F6D3EC.5000103@opencloud.com> <Pine.BSO.4.56.0501251824160.15166@leary.csoft.net> <41F6D733.7010702@opencloud.com> <BAYC1-PASMTP0228507F4378F1CA76C8E995870@cez.ice> <41F7F3D0.90809@opencloud.com> <BAYC1-PASMTP034FB41F0D2750919A332895870@cez.ice>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox