Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2B73F9FB319 for ; Fri, 13 Oct 2006 07:35:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 89019-07 for ; Fri, 13 Oct 2006 10:35:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 81C4C9FB2FB for ; Fri, 13 Oct 2006 07:35:42 -0300 (ADT) Received: (qmail 31847 invoked from network); 13 Oct 2006 10:35:40 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 13 Oct 2006 10:35:40 -0000 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> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Markus Schaber , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Retrieving arrays Date: Fri, 13 Oct 2006 06:35:29 -0400 To: Bendik Rognlien Johansen X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/85 X-Sequence-Number: 15968 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 >