Re: Pg 8.3, jdbc and UUID

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Pg 8.3, jdbc and UUID
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C202F762F0@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Pg 8.3, jdbc and UUID  (Mario Splivalo <mario.splivalo@megafon.hr>)
Список pgsql-jdbc
Mario Splivalo wrote:
> What would be the best way to use JDBC and UUIDs?
> 
> Since the only interface between the java codebase and postgres RDBMS is 
> trough the pl/pgsql functions, shall I write my functions to accept 
> varchars, and there convert them to uuids, same thing for returning 
> UUIDS to java?

The best interface is text; you can (implicitly) cast UUID to text
(or char or varchar) and vice versa.

So you can for example just use java.sql.PreparedStatement.setString()
to set an UUID.

Yours,
Laurenz Albe

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Deadlock detection
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Deadlock detection