From: Kris Jurka <books@ejurka.com>
To: Assad Jarrahian <jarraa@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] SQLData user-defined-types and getObject()
Date: Sun, 8 Jan 2006 03:17:19 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0601080311300.11669@leary.csoft.net> (raw)
In-Reply-To: <4bd3e1480601071928r372ccb5ct8653d50558edeba@mail.gmail.com>
References: <4bd3e1480601071928r372ccb5ct8653d50558edeba@mail.gmail.com>
On Sat, 7 Jan 2006, Assad Jarrahian wrote:
> I am quite confused (PLEASE PLEASE Help), I cannot find anything on
> the web). I read that you can declare a class that implements SQLData
> (in this case I set up a class called Complex from the /src/tutorial
> datatype that mimics the user-defined datatype in the db) and then set
> the mapping appropriately (see below).
This is possible according to the JDBC spec, but the postgresql driver
does not implement it. At the moment your only option is to have your
class implement org.postgresql.util.PGobject and register it using a pg
specific method. This is fine for a true user defined type, but it
certainly isn't ideal for a composite type because it requires the type
creator to handle all of the fields himself.
There isn't much documentation on PGobject implementations either, but the
javadoc and source code will point you in the right direction.
http://jdbc.postgresql.org/documentation/publicapi/org/postgresql/util/PGobject.html
Kris Jurka
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: books@ejurka.com, jarraa@gmail.com, pgsql-general@postgresql.org
Subject: Re: [JDBC] SQLData user-defined-types and getObject()
In-Reply-To: <Pine.BSO.4.61.0601080311300.11669@leary.csoft.net>
References: <4bd3e1480601071928r372ccb5ct8653d50558edeba@mail.gmail.com> <Pine.BSO.4.61.0601080311300.11669@leary.csoft.net>
* 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