X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 807149DC99E for ; Mon, 19 Dec 2005 18:09:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68919-08 for ; Mon, 19 Dec 2005 18:09:40 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web32001.mail.mud.yahoo.com (web32001.mail.mud.yahoo.com [68.142.207.98]) by postgresql.org (Postfix) with SMTP id 56F419DC97E for ; Mon, 19 Dec 2005 18:09:36 -0400 (AST) Received: (qmail 81811 invoked by uid 60001); 19 Dec 2005 22:09:38 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ojc7AGk9FkM4fewklbfPDhsQKDbDjOf9iuKuRfhGaHD64mE4Ff3/e0Pz4a/6QeXW5i2PE1WGZhzrwZs+L+PrFPsO4aVYyssg2RK8cRwKr9dQWjsZeujufTqalUDHb9tRQpPhIpzDbkGkCBKjdA4bW7l1vYpR/xkXNSiWf2YehEE= ; Message-ID: <20051219220938.81809.qmail@web32001.mail.mud.yahoo.com> Received: from [165.123.243.168] by web32001.mail.mud.yahoo.com via HTTP; Mon, 19 Dec 2005 14:09:37 PST Date: Mon, 19 Dec 2005 14:09:37 -0800 (PST) From: "j.random.programmer" Subject: Re: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly To: Dave Cramer Cc: pgsql-jdbc@postgresql.org In-Reply-To: <81D78292-95EC-44DD-B4CE-D9708D42F21B@fastcrypt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.419 required=5 tests=[AWL=-0.060, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.419 X-Spam-Level: X-Archive-Number: 200512/84 X-Sequence-Number: 14415 Dave: > The problem is that we don't know in advance if the > underlying column > is a bit, or a boolean. Postgresql supports > both, the jdbc API doesn't appear to. You can get from the database the actual type defined in the database for that column right ? (so if it's BIT your driver can tell it's BIT in the database, I presume). So then, as per the JDBC spec 1) while retrieving: convert that BIT (however long it may be) into a boolean [true, say, it it's all 1's else false]. 2) while saving: convert java true to a '1' and save that as a BIT (convert java false to '0'). That's what the spec suggests from what I can tell. Of course, you could also convert the BIT into a string if the user wants it as a string). Best regards, --j __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com