java中调⽤存储过程并传递list集合参数的⽅法
sql:
CREATE OR REPLACE TYPE test as object(
FID NUMBER,
NUM nVARCHAR2(30),
TESKID NUMBER,
CID NUMBER,
USERCODE nVARCHAR2(100)
)
CREATE OR REPLACE TYPE test_list as table of test
CREATE OR REPLACE PROCEDURE inserttenumber(
v_rec_class_list IN test_list)is
v_rec_class test;
v_count number;
begin
v_count := v_rec_unt;
for i in 1..v_count
loop
v_rec_class:=v_rec_class_list(i);
insert into
te_number(id,fid,NUM,teskid,STATE,cid,user_code)val,v_rec_class.fid,v_rec_class.NUM,v_skid,'-2',v_rec_class.cid,v_rec_class.USERCODE);
end loop;
end inserttenumber;
java
Connection con = null;
java下载过程CallableStatement cstmt = null;
try {
ApplicationContext applicationContext=new ClassPathXmlApplicationContext("classpath:spring/applicationContext-
DataSource datasource=(Bean("dataSource");
List list = new ArrayList();
for (int i = 0; i < Rows(); i++) {
Cell c01 = Cell(1, i);
Cell c00 = Cell(0, i);
if(!"".Contents())&&!"".Contents())){
total++;
Object[] record = new Object[5];
record[0] = tn.getFid();
record[1] = Contents();
record[2] = tn.getTeskId();
record[3] = tn.getCid();
record[4] = Contents();
list.add(record);
}
if(i%1000==0){
firebug是谷歌浏览器的常用插件con=(Connection) Connection(datasource);
System.out.println(con.hashCode()+"======="+list.size());
list.clear();
System.out.println(con.isClosed());
}
}
System.out.println("============"+list.size());
con=(Connection) Connection(datasource);
con.close();
tt.setCount(total);
md.addObject("total",total);
md.addObject("error",tf.getCount()-total);
} catch (Exception e) {
System.out.println("=============新增任务,导⼊号码⽂件错误");
e.printStackTrace();
}
closeExcel(rwb);
===================
public void test1(List list,Connection con) throws Exception{
StructDescriptor recDesc = ateDescriptor("TEST", con);
ArrayList<STRUCT> pstruct = new ArrayList<STRUCT>();
System.out.println(new Date());
for (int i = 0;i<list.size();i++) {
Object[] record = (Object[])(i);
count系列函数怎么用vb中inputbox如何输出STRUCT item = new STRUCT(recDesc, con, record);
pstruct.add(item);
}
ArrayDescriptor tabDesc = ateDescriptor("TEST_LIST", con); ARRAY vArray = new ARRAY(tabDesc, con, Array());
System.out.println(new Date());
CallableStatement cstmt = null;
cstmt = (CallableStatement) con.prepareCall("{call inserttenumber(?)}");
System.out.println(new Date());
cstmt.setArray(1, vArray);
System.out.println(new Date());vba sort排序
System.out.println(new Date());
conmit();
cstmt.close();
con.close();
System.out.println(new Date()+"==========执⾏完成"+con.isClosed());
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论