Re: Custom types and JDBC - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Custom types and JDBC
Date
Msg-id 4DCAAC12.6020006@gmail.com
Whole thread Raw
In response to Re: Custom types and JDBC  (mephysto <gennaria@email.it>)
List 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.klaver@gmail.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: full text search to_tsquery performance with ispell dictionary
Next
From: Tom Lane
Date:
Subject: Re: Custom types and JDBC