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 F0AF052863 for ; Wed, 15 Jun 2005 19:50:52 -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 18800-03 for ; Wed, 15 Jun 2005 22:50:35 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 5FFDC52823 for ; Wed, 15 Jun 2005 19:50:34 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DigiR-000184-5F; Thu, 16 Jun 2005 10:50:36 +1200 Message-ID: <42B0B0BA.9090504@opencloud.com> Date: Thu, 16 Jun 2005 10:50:34 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Donny Tjandra Cc: "'pgsql-jdbc@postgresql.org'" Subject: Re: Function not found with JDBC 8.0 driver and later References: In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/81 X-Sequence-Number: 13043 Donny Tjandra wrote: > I'm running PostgreSQL 8.0.3 for Windows. In the database I have a > function defined like this: > > CREATE OR REPLACE FUNCTION get_property_list2(text, date, int4, int4) > ... > > The parameters are passed from JDBC like this: > > PreparedStatement ps > ps.setInt(3, ((Integer)queryParameters[2]).intValue()); > ps.setLong(4, ((Long)queryParameters[3]).longValue()); > > With pg73jdbc3.jar the function call works fine. With > pg80b1.308.jdbc3.jar or postgresql-8.0-311.jdbc3.jar, the driver can't > seem to recognize the database function. I get stack trace as shown > below. Seems like there's a mismatch with long integer type mapping > between 8.0+ JDBC drivers and PostgreSQL? Can this be looked at for > future release of the driver? Thanks. This is an application bug -- either explicitly cast the parameter to the right type in the query itself, or use an appropriate parameter setting method (setInt or setObject(..., Types.INTEGER) in your case). The change was that the 8.0 driver now uses server-side preparation of queries which means that parameters are more strongly typed -- you don't get the previous implicit conversion from a textual representation of the parameter to whatever type seems correct. -O