X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3C1A652AC9 for ; Thu, 11 Aug 2005 10:23:45 -0300 (ADT) 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 11762-07 for ; Thu, 11 Aug 2005 13:23:43 +0000 (GMT) Received: from eui3smtp.euskaltel.es (eui3smtp.euskaltel.es [212.55.8.58]) by svr1.postgresql.org (Postfix) with ESMTP id B6C2752869 for ; Thu, 11 Aug 2005 10:23:41 -0300 (ADT) Received: from [192.168.1.65] ([83.213.182.196]) by eui3smtp.euskaltel.es (Netscape Messaging Server 4.15) with ESMTP id IL27VK02.V0W for ; Thu, 11 Aug 2005 15:23:44 +0200 From: Andres Ledesma To: pgsql-jdbc@postgresql.org Subject: postgresql and java data types mismatch..... Date: Thu, 11 Aug 2005 13:23:42 +0000 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508111323.42615.aledes@euskalnet.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.75 tagged_above=0 required=5 tests=[DNS_FROM_RFC_ABUSE=0.374, DNS_FROM_RFC_POST=1.376] X-Spam-Level: * X-Archive-Number: 200508/75 X-Sequence-Number: 13644 Hi, I have got and issue about data types, perhaps I'm missing some info I should know, or there is anything wrong in the code, but I would like that if someone knows why this happens, ust explain it to me. According to documentation, java.sql.Types.BOOLEAN is the equivalence of SQL BOOLEAN, but a function returning a boolean, returns something matched to Types.BIT in java. It happens in the following code. java code: ....... vars declarations, etc... boolean is_client = false; //procedure call cs = conn.prepareCall("{ ? = call get_is_client( ? ) }"); cs.registerOutParameter(1, Types.BOOLEAN); cs.setInt(2, client_id); cs.execute(); is_client = cs.getBoolean(1); ..... plpgsql function : CREATE OR REPLACE FUNCTION get_is_client() RETURNS boolean AS ' BEGIN RETURN is_true; END; ' LANGUAGE plpgsql; When run the java code, I receive the following message : A CallableStatement Function was executed and the return was of type (java.sql.Types=-7) however type=java.sql.Types=16 was registered. Types = -7 correspond to Types.BIT Types = 16 correspond to Types.BOOLEAN That's all. Thanks in advance. Best regards. -- Andres Ledesma =================