• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Communication between Oracle Objects and Java Program

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sateesh, please note that JavaRanch requires that you create a name that contains both a first and last name. Thanks!
 
Then YOU must do the pig's work! Read this tiny ad. READ IT!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic