From: Dave Cramer <pg@fastcrypt.com>
To: Bendik Rognlien Johansen <bensmailinglists@gmail.com>
Cc: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Retrieving arrays
Date: Fri, 13 Oct 2006 06:35:29 -0400
Message-ID: <C3149482-53FB-42C2-A810-B82531276225@fastcrypt.com> (raw)
In-Reply-To: <06A202FE-D5CB-4087-9838-C3E2AB4181DE@gmail.com>
References: <533747B3-BC3C-4D07-A2B8-A3C86B85C718@gmail.com>
<452CE6B0.10409@logix-tt.com>
<02302CAD-88BF-445E-A642-40EE4266045B@gmail.com>
<452CF4ED.9040301@logix-tt.com>
<06A202FE-D5CB-4087-9838-C3E2AB4181DE@gmail.com>
Patches are welcome
I haven't looked at the spec, but I also think this is outside of the
spec, but we have discussed it and feel it is intuitive enough to
accept.
Dave
On 13-Oct-06, at 4:58 AM, Bendik Rognlien Johansen wrote:
> Hello,
>
> In PL/Java:
> String[] values = (String[]) rs.getObject(column);
>
> Regular driver:
> String[] values = (String[]) rs.getArray(column).getArray();
>
> Strange..
>
> On Oct 11, 2006, at 3:43 PM, Markus Schaber wrote:
>
>> Hi, Bendik,
>>
>> Bendik Rognlien Johansen wrote:
>>
>>> yes you are right, I don't really understand Generics that well.
>>> But it
>>> is a little clearer now :-)
>>>
>>> Anyway, I was hoping there would be a clean way to get arrays
>>> from the
>>> result set, Generics or not, using a single method. I would like
>>> to avoid:
>>> getStringArray, getIntegerArray etc.
>>
>> Usually, ResultSet.getArray() should do it.
>>
>>> The reason I need to do this is that I use two different drivers for
>>> PostgreSQL with the same code, and they handle arrays differently.
>>
>> So you say that the the other one (pljava, IIRC) maps a postgresql
>> integer[] to an java.lang.Integer[] in java, and not an int[] like
>> pgjdbc?
>>
>> Looks strange.
>>
>> Does the jdbc spec promote one or the other behaviour?
>>
>> However, I don't know a clean solution.
>>
>> Markus
>> --
>> Markus Schaber | Logical Tracking&Tracing International AG
>> Dipl. Inf. | Software Development GIS
>>
>> Fight against software patents in Europe! www.ffii.org
>> www.nosoftwarepatents.org
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
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: pg@fastcrypt.com, bensmailinglists@gmail.com, schabi@logix-tt.com
Subject: Re: Retrieving arrays
In-Reply-To: <C3149482-53FB-42C2-A810-B82531276225@fastcrypt.com>
References: <533747B3-BC3C-4D07-A2B8-A3C86B85C718@gmail.com> <452CE6B0.10409@logix-tt.com> <02302CAD-88BF-445E-A642-40EE4266045B@gmail.com> <452CF4ED.9040301@logix-tt.com> <06A202FE-D5CB-4087-9838-C3E2AB4181DE@gmail.com> <C3149482-53FB-42C2-A810-B82531276225@fastcrypt.com>
* 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