Re: Custom type woes

From: Kris Jurka <books(at)ejurka(dot)com>
To: CG <cgg007(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Custom type woes
Date: 2006-06-29 23:00:08
Message-ID: Pine.BSO.4.63.0606291757250.26248@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 28 Jun 2006, CG wrote:

> I'm trying to use the datatype defined in the uniqueidentifier contrib
> module from within my java application. I had originally thought I would
> process the values in java as strings, but I can't insert the values
> back into a table becuase I can't figure out how to create an explicit
> cast. I had hoped that the automatic type conversion would work, but it
> doesn't in the case of insert, or in function parameters.

If you use the 8.2dev driver and create your connection using the
stringtype=unspecified, then these automatic casts should work.

http://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters

> My next idea was to add the type to JDBC a la Money and Interval. I've never
> worked with JDBC drivers before, so I just guessed at what it would take. I
> created the java class PGuniqueidentifier and modeled it after the other
> classes in org.postgresql.util. I linked it up along with all the other odd
> types in org.postgresql.jdbc2.AbstractJdbc2Connection ... That didn't work
> either.

Could you describe didn't work? I don't see why it wouldn't.

> SQLWorkbench reports columns of uniqueidentifier as java sql type OTHER ...
>

It will still do that regardless of what you do. What java.sql.Type would
you like it to use and how could it know that?

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2006-06-29 23:08:27 Re: bytea memory improvement
Previous Message Tamás Barta 2006-06-29 07:34:59 Re: JDBC Driver