Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 41C4A9FA1FE for ; Fri, 1 Dec 2006 10:08:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 69345-06 for ; Fri, 1 Dec 2006 10:08:21 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with ESMTP id 5BA929FA25D for ; Fri, 1 Dec 2006 10:07:56 -0400 (AST) Received: by mail63.csoft.net (Postfix, from userid 1112) id 415C7F2C7; Fri, 1 Dec 2006 09:07:55 -0500 (EST) Date: Fri, 1 Dec 2006 09:07:55 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: =?ISO-8859-15?Q?Ingmar_L=F6tzsch?= cc: pgsql-jdbc@postgresql.org Subject: Re: PreparedStatement and TYPE bit In-Reply-To: <456C0577.6000100@asci-systemhaus.de> Message-ID: References: <456BFE20.8010400@asci-systemhaus.de> <456C0577.6000100@asci-systemhaus.de> MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 200612/21 X-Sequence-Number: 16253 On Tue, 28 Nov 2006, Ingmar L=F6tzsch wrote: > Ingmar L=F6tzsch 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= =20 to postgresql using the PGobject class to pass the correct type=20 information to setObject. You can does this again with the 8.2 driver if you add the URL parameter=20 stringtype=3Dunspecified. I think the best long term approach is for getObject and setObject to=20 return/take BitSet objects directly so no conversion to string is needed. Kris Jurka=