Re: (How to) Make SQLData of UUID?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: (How to) Make SQLData of UUID?
Date: 2019-07-22 06:22:16
Message-ID: bc8fde4a-2bbf-e8a3-a542-bb9f71520593@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Alexander Myodov schrieb am 22.07.2019 um 01:43:
> The problem is not in making a PL/PgSQL function returning an UUID.
> Or even returning a custom type containing an UUID (like
> MYFUNC_RETURN_TYPE in my case). The problem is on Java level, when I
> need to make a Java handler/mapping of PostgreSQL custom type (which
> contains an UUID internally).

You don't need a wrapper.

ResultSet.getObject(1, UUID.class)

and

PreparedStatement.setObject(1, someUUID);

will work just fine.

Thomas

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alexander Myodov 2019-07-23 00:44:39 (How to) Make composite PGObject with Text? (Was: (How to) Make SQLData of UUID?)
Previous Message Alexander Myodov 2019-07-21 23:43:20 Re: (How to) Make SQLData of UUID?