Unix Technical Forum

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

This is a discussion on How to pass more than one records from Oracle to Java? within the Oracle Database forums, part of the Database Server Software category; --> Hi, I have a specific situation where we will be passing more than one record from Oracle to Java. ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-24-2008, 11:56 AM
Karuna
 
Posts: n/a
Default How to pass more than one records from Oracle to Java?

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-24-2008, 11:56 AM
Shanmuhanathan T
 
Posts: n/a
Default Re: How to pass more than one records from Oracle to Java?

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/sam...mple.java.html

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

Regards
--
Shanmu.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-24-2008, 12:34 PM
karuna
 
Posts: n/a
Default Re: How to pass more than one records from Oracle to Java?

Thank you so much.

Thanks
Karuna

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-24-2008, 12:38 PM
dba.orcl@gmail.com
 
Posts: n/a
Default Re: How to pass more than one records from Oracle to Java?

better use refcursor with temp table.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com