Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 7E7699FB1C6 for ; Sat, 3 Feb 2007 15:25:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 76310-06 for ; Sat, 3 Feb 2007 15:25:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from titan.startnet.cz (unknown [82.113.63.73]) by postgresql.org (Postfix) with ESMTP id 8256A9FA50C for ; Sat, 3 Feb 2007 15:25:49 -0400 (AST) Received: (qmail 22984 invoked from network); 3 Feb 2007 20:25:46 +0100 Received: from 89-24-5-70.customers.t-mobile.cz (HELO ?172.24.56.44?) (miroslav.sulc@startnet.cz@89.24.5.70) by titan.local.startnet.cz with ESMTPA; 3 Feb 2007 20:25:46 +0100 Message-ID: <45C4E1A6.3020401@startnet.cz> Date: Sat, 03 Feb 2007 20:25:26 +0100 From: =?ISO-8859-2?Q?Miroslav_=A9ulc?= Organization: StartNet s.r.o. User-Agent: Thunderbird 1.5.0.9 (X11/20061224) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: JDBC and arrays References: <45C295F4.4030100@startnet.cz> <45C304FB.6020702@startnet.cz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.123 tagged_above=0 required=5 tests=AWL, BAYES_50, RCVD_IN_BL_SPAMCOP_NET X-Spam-Level: * X-Archive-Number: 200702/27 X-Sequence-Number: 16583 I got writing of inet[] working through object that implements PGobject (you were right, it works only with _inet), but I cannot read inet[]. I thought I'll get String[] through getArray(index).getArray() but instead I get an exception on getArray(index). What is the correct way to read inet[]? Caused by: org.postgresql.util.PSQLException: Method org.postgresql.jdbc3g.Jdbc3gArray.getArrayImpl(long,int,Map) is not implemented. at org.postgresql.Driver.notImplemented(Driver.java:728) at org.postgresql.jdbc2.AbstractJdbc2Array.getArrayImpl(AbstractJdbc2Array.java:228) at org.postgresql.jdbc2.AbstractJdbc2Array.getArray(AbstractJdbc2Array.java:71) at cz.startnet.utils.java.sql.ResultSetUtils.getValue(ResultSetUtils.java:253) -- Miroslav Šulc Kris Jurka napsal(a): > > > On Fri, 2 Feb 2007, Miroslav Šulc wrote: > >> Thank you for explanation. If I still want to write inet[] data, is >> it sufficient to implement PGobject so it returns 'inet[]' type and >> '{ "ip", "ip" }' value and pass that to setObject()? > > That should work although you'll probably need to write _inet instead > of inet[]. The underscore variant is the the backend's true datatype > name and I'm not sure if it will accept the other version in this > context.