JDBC support for 8.1 OUT parameters

From: "Adam Zimowski" <zimowski74(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: JDBC support for 8.1 OUT parameters
Date: 2006-03-05 16:26:36
Message-ID: 7c6c1dd90603050826o12028bbej847550e44dc7c0c8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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=1111 however type
java.sql.Types=0 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 = null;
stmt = 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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Adam Zimowski 2006-03-05 16:46:11 Re: JDBC support for 8.1 OUT parameters
Previous Message Michael Fuhr 2006-03-04 05:00:43 Re: Aggregate function for a text column