Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 833AA9FB1E7 for ; Tue, 28 Nov 2006 05:15:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 46862-05 for ; Tue, 28 Nov 2006 05:15:22 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by postgresql.org (Postfix) with ESMTP id C76AB9FA430 for ; Tue, 28 Nov 2006 05:15:22 -0400 (AST) Received: from [83.236.232.74] (helo=[192.168.200.83]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), id 0MKxQS-1Goz3g0hTz-0004fO; Tue, 28 Nov 2006 10:15:20 +0100 Message-ID: <456BFE20.8010400@asci-systemhaus.de> Date: Tue, 28 Nov 2006 10:15:12 +0100 From: =?ISO-8859-15?Q?Ingmar_L=F6tzsch?= User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: PreparedStatement and TYPE bit X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:ceb22bc633ad987f91db23b9b4f83498 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/154 X-Sequence-Number: 16196 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. String sql = "... WHERE f1.verkehrstage & B? <> 0::bit(384) ..."; PreparedStatement pstmt_select1 = con.prepareStatement(sql); BigInteger mybits = ... // padding bits 0 on the left up to 384 (type bit(384)) String querybits = mybits.or(this.bit384).toString(2).substring(1); pstmt_select1.setString(1, querybits); ... ResultSet rs = pstmt_select1.executeQuery(); This does not work in versions 8.x. Thank you