Re: PreparedStatement and TYPE bit - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: PreparedStatement and TYPE bit
Date
Msg-id Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net
Whole thread Raw
In response to Re: PreparedStatement and TYPE bit  (Ingmar Lötzsch <iloetzsch@asci-systemhaus.de>)
List pgsql-jdbc

On Tue, 28 Nov 2006, Ingmar Lötzsch wrote:

> Ingmar Lötzsch schrieb:
>> Hallo,
>>
>> how can I use PreparedStatement to insert or update columns of type
>> bit(n), varbit, ...?
>>
>> I have never figoured out the right way. In former versions of the
>> JDBC-Driver I used setString() as shown below or constructed the whole
>> query string and used Statement.

With the 8.0 and 8.1 driver you would need to write code that is specific
to postgresql using the PGobject class to pass the correct type
information to setObject.

You can does this again with the 8.2 driver if you add the URL parameter
stringtype=unspecified.

I think the best long term approach is for getObject and setObject to
return/take BitSet objects directly so no conversion to string is needed.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: setBlob/getBlob, slony and bytea
Next
From: Kris Jurka
Date:
Subject: Re: ParsedStatement Behavior