Re: Custom types and JDBC

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: mephysto <gennaria(at)email(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Custom types and JDBC
Date: 2011-05-11 15:32:34
Message-ID: 4DCAAC12.6020006@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/11/2011 08:03 AM, mephysto wrote:
> Mmmmm no,
> my goal is for example: define a typeFoo (id as int, name as varchar) in
> postgres, define an object in java objFoo (id as int, name string), define a
> stored function in posgres return a typeFoo
>
>
> create ora replace function getFoo() returns typeFoo as
> $$
> begin
> ......
> end;
> $$
>
> I would to connect postgres by jdbc and call stored function getFoo. A this
> poin I would set properties of objFoo (id and name) with id and name
> retrieved from stored function.
>
> Is resultset the only way to achieve this goal?

As far as I can tell, yes. If the values for id and name never changed
you could just hard code them as properties of objFoo. Assuming that the
function getFoo() changes the values, the only way you can know what the
new values are is query the database and get them from the result set.

>
> Thanks.
>
> Meph
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-05-11 15:50:10 Re: Custom types and JDBC
Previous Message Tom Lane 2011-05-11 15:31:15 Re: full text search to_tsquery performance with ispell dictionary