"out" parameters in CallableStatements

Поиск
Список
Период
Сортировка
От David Parker
Тема "out" parameters in CallableStatements
Дата
Msg-id 07FDEE0ED7455A48AC42AC2070EDFF7C0C0223@corpsrv2.tazznetworks.com
обсуждение исходный текст
Ответы Re: "out" parameters in CallableStatements
Список 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 по дате отправления:

Предыдущее
От: "John R Pierce"
Дата:
Сообщение: Re: JDBC DRIVER FOR HANDHELDS
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Integer fields