Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

passing an array of objects to stored proc(Oracle)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have to pass an array of objects to a pl/sql stored proc.
Its prototype is,
proc_orderins(ordernum varchar2(14), ct newTask)

where newTask is an array of objects:
type task as object ( name varchar2(20),odd varchar2(8),sdd varchar2(8));

create or replace type newTask as VARRAY(25) OF Task;

will the following work from the java code :
public class CriticalTask
{
String name,odd,sdd;
public CrticalTask(String name,String odd,String sdd)
{
this.name=name;
this.odd=odd;
this.sdd=sdd;
}
}
Object [] ctasks =new Object[7];
for(i=0;i<7;i++)
Object=new CrtitcalTask("x","x","x");

String query="{call proc_orderins(?,?)}";
CallableStatement cstmt=con.prepareCall(query);
cstmt.setInt(123);
cstmt.setObject(ctasks);
cstmt.execute();

will the above code work, when I am passing an array?
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"priyam rao12",
Please check your private messages.

Thank you,
Jeanne
JavaRanch Sheriff
 
    Bookmark Topic Watch Topic
  • New Topic