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

Home -> Community -> Usenet -> c.d.o.server -> Re: Java ResultSet from PL/SQL Output?

Re: Java ResultSet from PL/SQL Output?

From: Noons <wizofoz2k_at_yahoo.com.au.nospam>
Date: Sat, 31 May 2003 20:36:28 +1000
Message-ID: <3ed885f2$0$16260$afc38c87@news.optusnet.com.au>


"May Nine" <may94111_at_yahoo.com> wrote in message news:275a5824.0305301826.715ef801_at_posting.google.com...

> I know my IDE is telling me that CallableStatement.getResultSet() is a
> valid method.

Indeed it is. Since Java 1.2

> My question is, what kind of Oracle object do I have my PL/SQL proc
> return so that CallableStatement.getResultSet() will work?

REF CURSOR. Define a variable of it in PL/SQL, open a SQL statement on it and return the variable. Look it up in the doco. You can have typeless REF CURSORs in which case you need to get the MetaData from JDBC to descrive the columns, or you can type them as an object and then you can use JPublisher to create your classes for Java.

> My motivation is to transfer something more complex than a
> simple array across the JDBC-PL/SQL boundry.

You can make an Object Type, create an Object view for it and do a REF CURSOR on it to return a complex type directly into a JDBC(1.2) java.sql.STRUCT type.

Look up Object Relational manual in the Application series of manuals, as well as the JDBC manual in the Java series of manuals. And there is some example code, search in $ORACLE_HOME/javavm.

--
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam
Received on Sat May 31 2003 - 05:36:28 CDT

Original text of this message

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