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 BDA809DC98F for ; Sun, 5 Mar 2006 12:46:14 -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 52086-06 for ; Sun, 5 Mar 2006 12:46:13 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.198]) by postgresql.org (Postfix) with ESMTP id B82869DC9E5 for ; Sun, 5 Mar 2006 12:46:11 -0400 (AST) Received: by zproxy.gmail.com with SMTP id 13so1060662nzn for ; Sun, 05 Mar 2006 08:46:11 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SlDzFw0g2f4+l5KB7eQT9DUGT/CCF4YJOthwAklJkAUsf6EFA0Enq+56xGyqTH/Ui2Zd3YK+95BKs7LV6LB54DmoqmIQwZS5apF86dhnn/rJn0Uc0N8GHaE92Q2Oc+rb96hhL/rpquCgHTkmAcCtavX0B3fcgY9HjlTLKjXAVuI= Received: by 10.36.222.12 with SMTP id u12mr1970777nzg; Sun, 05 Mar 2006 08:46:11 -0800 (PST) Received: by 10.36.222.11 with HTTP; Sun, 5 Mar 2006 08:46:11 -0800 (PST) Message-ID: <7c6c1dd90603050846j6d1987ffnbbddbcd01f0fd11f@mail.gmail.com> Date: Sun, 5 Mar 2006 10:46:11 -0600 From: "Adam Zimowski" To: pgsql-jdbc@postgresql.org Subject: Re: JDBC support for 8.1 OUT parameters In-Reply-To: <7c6c1dd90603050826o12028bbej847550e44dc7c0c8@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7c6c1dd90603050826o12028bbej847550e44dc7c0c8@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.258 required=5 tests=[AWL=-0.018, MAILTO_TO_SPAM_ADDR=0.276] X-Spam-Score: 0.258 X-Spam-Level: X-Archive-Number: 200603/19 X-Sequence-Number: 14800 Just a quick note: In my code I'm using Types.OTHER. As a troubleshooting step I also tried Types.REF. The PostgreSQL version I'm on is 8.1.0. CREATE OR REPLACE FUNCTION main.p_get_profile_simple(IN _profile_id int8, OUT _main refcursor, OUT _lookingfor refcursor, OUT _purpose refcursor) AS .... CallableStatement stmt =3D null; stmt =3D oCon.prepareCall("{ call main.p_get_profile_simple(?,?,?,?) }"); stmt.setLong(1, aMemberId); stmt.registerOutParameter(2, Types.OTHER); stmt.registerOutParameter(3, Types.OTHER); stmt.registerOutParameter(4, Types.OTHER); Regards, Adam On 3/5/06, Adam Zimowski wrote: > Hi, > > Do you know where I can find Postgres JDBC driver that supports out > parameters? When I call my procedure, I'm getting: > > org.postgresql.util.PSQLException: A CallableStatement function was > executed and the return was of type java.sql.Types=3D1111 however type > java.sql.Types=3D0 was registered. > > I'm pretty sure the driver version I have > (postgresql-8.1-405.jdbc3.jar) supports OUT only on first parameter. > I've looked on the web but did not find anything. I saw a few patches, > but I wasn't sure if they were it. > > CREATE OR REPLACE FUNCTION main.p_get_profile_simple(IN _profile_id > int8, OUT _main refcursor, OUT _lookingfor refcursor, OUT _purpose > refcursor) AS > .... > > CallableStatement stmt =3D null; > stmt =3D oCon.prepareCall("{ call main.p_get_profile_simple(?,?,?,?) }"); > stmt.setLong(1, aMemberId); > stmt.registerOutParameter(2, Types.REF); > stmt.registerOutParameter(3, Types.REF); > stmt.registerOutParameter(4, Types.REF); > > Regards, > Adam >