Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Q: jdbc and stored procedures returning several outparameters

Re: Q: jdbc and stored procedures returning several outparameters

From: Jim McMahon <jp_mcmahon_at_hotmail.com>
Date: Wed, 28 Sep 2005 10:33:41 GMT
Message-ID: <433a706c.2175795635@nntp.charter.net>


Trond Kandal <trond.kandal_at_itea.ntnu.no> wrote:

>hello
>
>is there anyone who have used jdbc and stored procedures that
>returns more than one outparameter?
>
>i have looked at some examples from oracle but they uses only
>one outparameter.
>
>ex:
>
>CallableStatement cs = conn.prepareCall ("begin ? := foo(?); end;");
>cs.registerOutParameter(1,Types.CHAR);
>cs.setString(2, "aa");
>cs.executeUpdate();
>String result = cs.getString(1);
>
>how do i write the code when i want to get more than one
>outparameter?
>
>thanks!
>
>
>trond.
>--
>Trond Kandal Organisasjonsavd. voice: +47 73597497
>Integrasjonsgruppa NTNU mobile:+47 91897110
>IT-seksjonen 7491 Trondheim fax: +47 73598200
>http://www.itea.ntnu.no/integrasjon
>
>This is Unix land.
>In quiet nights you can hear M$-Windoze machines reboot.

I easily found the following in the Oracle documentation set by typing "registerOutParameter" as a search parameter.

FROM
Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 :

registerOutParameter(): registers the SQL type code of the statement's output parameter. JDBC requires this for any callable statement with an OUT parameter. It takes an integer parameter index (the position of the output variable in the statement, relative to the other parameters) and an integer SQL type (the type constant defined in oracle.jdbc.driver.OracleTypes).

This is an overloaded method. There is a version of this method that you use for named types only; that is, when the SQL type code is OracleTypes.REF, STRUCT, or ARRAY. In this case, in addition to a parameter index and SQL type, the method also takes a String SQL type name (the name of the Oracle object type in the database, such as EMPLOYEE). Being ordinary and nothing special is a full-time job. jp_mcmahon_at_hotmail.com (Jim McMahon in real life) Received on Wed Sep 28 2005 - 05:33:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US