"out" parameters in CallableStatements - Mailing list pgsql-jdbc

From David Parker
Subject "out" parameters in CallableStatements
Date
Msg-id 07FDEE0ED7455A48AC42AC2070EDFF7C0C0223@corpsrv2.tazznetworks.com
Whole thread Raw
Responses Re: "out" parameters in CallableStatements  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Hi. I need to provide a stored procedure interface to my postgres
database that conforms as much as possible to an existing Oracle stored
procedure interface in a product with which we are integrating. These
are called via JDBC. The Oracle interface has OUT parameters, which are
not supported by postgres, so I assume my stored procedures just need to
return this value (luckily, they only seem to have one OUT parameter per
procedure, which they use for a result).

I'm not sure how to handle this at the JDBC level. The example in the
postgres documentation (page 417 in the 7.4 doc) gives:

CallableStatement upperProc = con.prepareCall("{ ? = call upper( ? )
}");
upperProc.registerOutParameter(1, Types.VARCHAR);
upperProc.setString(2, "lowercase to uppercase");
upperProc.execute();
String upperCased = upperProc.getString(1);
upperProc.close();

Is the JDBC driver doing something special to support the
registerOutParameter call? Assuming that it is using this to map the
return value of the stored procedure, does it check that only one OUT
parameter is registered, or limit it to parameter 1?

TIA for any info.

-  DAP
======================================================
David Parker    Tazz Networks    (401) 709-5130


pgsql-jdbc by date:

Previous
From: "John R Pierce"
Date:
Subject: Re: JDBC DRIVER FOR HANDHELDS
Next
From: Kris Jurka
Date:
Subject: Re: Integer fields