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: How to pass more than one records from Oracle to Java?

Re: How to pass more than one records from Oracle to Java?

From: Shanmuhanathan T <shanmuha_at_mailinator.com>
Date: Tue, 15 Mar 2005 12:39:06 +0530
Message-ID: <73wZd.30$Bc4.274@news.oracle.com>


Karuna said,on 3/15/2005 12:25 PM:
> Hi, I have a specific situation where we will be passing more than one
> record from Oracle to Java. I think its not a good idea to pass
> everything in a single string and then convert it. We tried VARRAY,
> INDEXED TABLE. Both is having problem. NESTED table may be a good
> option, but this inturn is going to store the values in table. So to
> pass n records, you have to insert n records to the NESTED table and
> then the procedure will pick up the n records from the database. After
> executing the procedure, again one has to delete the contents of
> nested table. If anyone has experience in this esp. using VARRAY or
> INDEXED table to pass more than one record to Java and back, please
> let me know. Thanks in advance.

This is possible using the thick driver (oci driver) in 9i/10g. Typically you would have a plsql collection as an OUT variable in a plsql procedure and in java would map an object array to that variable and use it. OTN has a code sample too:
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/9i_jdbc/PlsqlTablesSample/PlsqlTablesSample.java.html

Can you please be a little specific on the problem you are facing when trying to do this?

Regards

-- 
Shanmu.
Received on Tue Mar 15 2005 - 01:09:06 CST

Original text of this message

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