Stored Procedures
ProcedureUPDATE_BATCH_ID (p_entity_idinch Number, p_vdr_idinchFnd_table_of_number) is begin forIinch 1.. p_vdr_id.COUNTLoopUpdatecux_table_header CVSSetCvs.attribute10=p_entity_idwherecvs.header_id=p_vdr_id (i); EndLoop; End;
Called in Java
New ArrayList ();.. list.add (Row.getheaderid ());
Oraclecallablestatement statement = null;
OracleConnection OracleConnection = (oracleconnection) tsn.getjdbcconnection ();
int size = list.size ();
if(size>0) {number[] Vdridarray= (number[]) List.toarray (NewNumber[size]); ARRAY Vdrarray=NULL;Try{arraydescriptor Tableofnumber=Oracle.sql.ArrayDescriptor.createDescriptor ("Fnd_table_of_number", OracleConnection); Vdrarray=NewARRAY (Tableofnumber, OracleConnection, Vdridarray); String SQL= "BEGIN cux_xxxxxxx_pkg." UPDATE_BATCH_ID (: 1,:2); end; "; Statement=(oraclecallablestatement) oracleconnection.preparecall (SQL); Statement.setobject (1, BatchId); Statement.setarray (2, Vdrarray); Statement.execute (); }Catch(Exception ex) {string[][] stra2= {"123456wewee", Ex.getmessage ()},}; Logutil.of (Stra2, This). Print (PageContext); Ex.printstacktrace (); System.out.println (Ex.getmessage ()); } }
A parameter type is defined as an array in a stored procedure