Re: Retrieving arrays - Mailing list pgsql-jdbc

From Markus Schaber
Subject Re: Retrieving arrays
Date
Msg-id 452CF4ED.9040301@logix-tt.com
Whole thread Raw
In response to Re: Retrieving arrays  (Bendik Rognlien Johansen <bensmailinglists@gmail.com>)
Responses Re: Retrieving arrays  (Dave Cramer <pg@fastcrypt.com>)
Re: Retrieving arrays  (Bendik Rognlien Johansen <bensmailinglists@gmail.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Bendik Rognlien Johansen
Date:
Subject: Re: Retrieving arrays
Next
From: Dave Cramer
Date:
Subject: Re: Retrieving arrays