pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Ingmar Lötzsch <iloetzsch@asci-systemhaus.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: PreparedStatement and TYPE bit
Date: Fri, 1 Dec 2006 09:07:55 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net> (raw)
In-Reply-To: <456C0577.6000100@asci-systemhaus.de>
References: <456BFE20.8010400@asci-systemhaus.de>
	<456C0577.6000100@asci-systemhaus.de>



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


view thread (3+ messages)

Message-ID: <Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net>
Permalink:  ../Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, iloetzsch@asci-systemhaus.de
  Subject: Re: PreparedStatement and TYPE bit
  In-Reply-To: <Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net>
  References: <456BFE20.8010400@asci-systemhaus.de> <456C0577.6000100@asci-systemhaus.de> <Pine.BSO.4.64.0612010904490.22186@leary2.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox