Skip site navigation (1) Skip section navigation (2)

Re: Pg 8.3, jdbc and UUID

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Mario Splivalo *EXTERN*" <mario(dot)splivalo(at)megafon(dot)hr>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Pg 8.3, jdbc and UUID
Date: 2009-01-21 16:09:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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.

Laurenz Albe

In response to

pgsql-jdbc by date

Next:From: Simon RiggsDate: 2009-01-22 00:16:50
Subject: Re: Deadlock detection
Previous:From: Simon RiggsDate: 2009-01-21 14:54:45
Subject: Re: Deadlock detection

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group