• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Need Help - Emergency

Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java program which sends to Oracle as parameter an method(Array[], Array[], String, Number) and returns the results set as an object, which I have to loop in my java program to display it. Could anyone tell me how to call this method in java and how to receive the results in an object from pl/sql. Thanks.
I have started with this, could anyone tell me if I'm doing it right and correct my program.
StructDescriptor desc1=StructDescriptor.createDescriptor("RECTYPE",ora._con);
STRUCT p1struct = new STRUCT(desc1, ora._con, p1obj1);
STRUCT p2struct = new STRUCT(desc1, ora._con, p1obj2);
OracleCallableStatement ocs = (OracleCallableStatement )
ora._con.prepareCall("{call " +
"pegasustypes.show_pegasus(?,?," +
ownerid + ", " + num + ")}");
ocs.setOracleObject(1, p1struct);
ocs.setOracleObject(2, p2struct);
p1struct = ocs.getSTRUCT(1);
p2struct = ocs.getSTRUCT(2);
Object [] p1obj = p1struct.getAttributes();
Object [] p2obj = p2struct.getAttributes();
for(int k = 0; k < infos.length; k++){
System.out.println("Record: " + p1obj[k] + " " + p2obj[k]);
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic