From: Miroslav Šulc <miroslav.sulc@startnet.cz>
To: pgsql-jdbc@postgresql.org
Subject: Re: JDBC and arrays
Date: Sat, 03 Feb 2007 20:25:26 +0100
Message-ID: <45C4E1A6.3020401@startnet.cz> (raw)
In-Reply-To: <Pine.BSO.4.64.0702021158370.19418@leary2.csoft.net>
References: <45C295F4.4030100@startnet.cz>
<Pine.BSO.4.64.0702020154310.31728@leary2.csoft.net>
<45C304FB.6020702@startnet.cz>
<Pine.BSO.4.64.0702021158370.19418@leary2.csoft.net>
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.
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: miroslav.sulc@startnet.cz
Subject: Re: JDBC and arrays
In-Reply-To: <45C4E1A6.3020401@startnet.cz>
References: <45C295F4.4030100@startnet.cz> <Pine.BSO.4.64.0702020154310.31728@leary2.csoft.net> <45C304FB.6020702@startnet.cz> <Pine.BSO.4.64.0702021158370.19418@leary2.csoft.net> <45C4E1A6.3020401@startnet.cz>
* 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