wood burning stoves 2.0*
The moose likes JDBC and the fly likes Communication between Oracle Objects and Java Program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Communication between Oracle Objects and Java Program" Watch "Communication between Oracle Objects and Java Program" New topic
Author

Communication between Oracle Objects and Java Program

sateesh
Greenhorn

Joined: Sep 25, 2000
Posts: 4
Hi,
I have created an Oracle Object which has some data members as VARRAYs . Inside my Java program , I am retrieving data from the table and assigning the values to the local variables. For ex..
Suppose my Object(Oracle) name is Person which is a column Object in the Table Tab1 and has a data member Accounts which is a VARRAY of VARCHAR2(100)
Now in my Java program
ResluSet rs=staement.executeQuery("select Person.Accounts as obj from Tab1");

But how to retrieve the data in the fileds which are VARRAYS , even though I write get and set methods in the Oracle Object what I should return from them and how to assign them to the String arrays...

Thanks in advance
Sateesh
ram menon
Greenhorn

Joined: Oct 24, 2000
Posts: 5
Hi,
You can use the Oracle extentions of jdbc to achieve this.
ARRAY array = ((OracleResultSet)rs).getARRAY (1);
Using array.getArray(), you can populate an array and then use that.
Note that in the select statement you should select the varray.
Hope this helps,
Ram
sateesh
Greenhorn

Joined: Sep 25, 2000
Posts: 4
Thanks Ram, I solved that problem using getARRAY() method, the problem was I have n't placed the drivers properly..
Any how thanks for the reply....
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
sateesh, please note that JavaRanch requires that you create a name that contains both a first and last name. Thanks!


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communication between Oracle Objects and Java Program
 
Similar Threads
Question on VARRAYS
how to stop escapeing '\' using java with postgres db
creating virtual tables
Index
How to export data from XML file to a table ?