X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 094BADBA80 for ; Thu, 24 Nov 2005 12:38:47 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64766-04 for ; Thu, 24 Nov 2005 16:38:45 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 33650DB941 for ; Thu, 24 Nov 2005 12:38:43 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EfK50-00032Y-4h for pgsql-jdbc@postgresql.org; Thu, 24 Nov 2005 17:36:14 +0100 Received: from ppp-82-135-75-212.mnet-online.de ([82.135.75.212]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Nov 2005 17:36:14 +0100 Received: from spam_eater by ppp-82-135-75-212.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Nov 2005 17:36:14 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: Why is bool == java.sql.Types.BIT ?? Date: Thu, 24 Nov 2005 17:34:00 +0100 Lines: 22 Message-ID: References: <43850037.5000608@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ppp-82-135-75-212.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.6) Gecko/20050317 Thunderbird/1.0.2 Mnenhy/0.7.2.0 X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <43850037.5000608@opencloud.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/192 X-Sequence-Number: 14290 Oliver Jowett wrote on 24.11.2005 00:50: > Thomas Kellerer wrote: > >> The problem comes when supporting multiple DBMS. With MS SQL Server a >> bit column can only store 0/1 (which is not what the driver returns, >> as it uses a java.lang.Boolean) but PG only accepts the literals >> true/false. That's why I stumbled over this in the first place. >> >> So I'll have to check the native type rather then the JDBC type to be >> sure. > > > Can't you use setBoolean()/getBoolean()? I think that's specified to > always work on a BIT column, whatever the real underlying type is. > Yes of course I can and actually I do when using PreparedStatements But when I'm generating SQL Scripts I need to use the correct literal for such a column. Regards Thomas