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 A9AB25280D for ; Wed, 15 Jun 2005 17:03:18 -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 84751-07 for ; Wed, 15 Jun 2005 20:03:13 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 8660152812 for ; Wed, 15 Jun 2005 17:03:10 -0300 (ADT) Received: (qmail 30530 invoked from network); 15 Jun 2005 20:01:21 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (64.7.143.116) by net2.micro-automation.com with SMTP; 15 Jun 2005 20:01:21 -0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/alternative; boundary=Apple-Mail-7-972153524 Message-Id: Cc: "'pgsql-jdbc@postgresql.org'" From: Dave Cramer Subject: Re: Function not found with JDBC 8.0 driver and later Date: Wed, 15 Jun 2005 16:03:10 -0400 To: Donny Tjandra X-Mailer: Apple Mail (2.730) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL, HTML_30_40, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200506/80 X-Sequence-Number: 13042 --Apple-Mail-7-972153524 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed This is because the 8.0 drivers expect you to pass an int when the function signature is int. Parameter 4 is an int, and you are passing a long. Dave On 15-Jun-05, at 3:13 PM, 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. > > java.sql.SQLException: ERROR: function get_property_list2(character > varying, date, integer, bigint) does not exist > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse > (QueryExecutorImpl.java:1471) > at org.postgresql.core.v3.QueryExecutorImpl.processResults > (QueryExecutorImpl.java:1256) > at org.postgresql.core.v3.QueryExecutorImpl.execute > (QueryExecutorImpl.java:175) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute > (AbstractJdbc2Statement.java:389) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags > (AbstractJdbc2Statement.java:330) > at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery > (AbstractJdbc2Statement.java:240) > at > org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery > (DelegatingPreparedStatement.java:92) > --Apple-Mail-7-972153524 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 This is because the 8.0 drivers = expect you to pass an int when the function signature is int. Parameter = 4 is an int, and you are passing a long.

Dave
On = 15-Jun-05, at 3:13 PM, 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) =
...
=A0 =
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.

java.sql.SQLException: ERROR: function = get_property_list2(character varying, date, integer, bigint) does not = exist
=A0=A0=A0=A0=A0=A0=A0 at = org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecuto= rImpl.java:1471)
=A0=A0=A0=A0=A0=A0=A0 at = org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.= java:1256)
=A0=A0=A0=A0=A0=A0=A0 at = org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:17= 5)
=A0=A0=A0=A0=A0=A0=A0 at = org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement= .java:389)
=A0=A0=A0=A0=A0=A0=A0 at = org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2= Statement.java:330)
=A0=A0=A0=A0=A0=A0=A0 at = org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Stat= ement.java:240)
=A0=A0=A0=A0=A0=A0=A0 at = org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(Deleg= atingPreparedStatement.java:92)

=

= --Apple-Mail-7-972153524--