✎
编程开发网
首页
C语言
C++
面试
Linux
函数
Windows
数据库
下载
搜索
当前位置:
首页
->
AI编程基础
->
c++编程基础
C++完成Oracle存储过程批量插入(一)(二)
2015-07-20 17:46:11
·
作者:
·
浏览:
10
标签:
完成
Oracle
存储
过程
批量
插入
) { _struct = new MutableStruct(new Object[_sqlType.length], _sqlType, _factory); } public Datum toDatum(Connection conn) throws SQLException { _struct.setAttribute(0, this.id); _struct.setAttribute(1, this.name); _struct.setAttribute(1, this.code); return _struct.toDatum(conn, _ORACLE_TYPE_NAME); } public PocoTestModel(String id,String name, String code) { this(); this.id = id; this.name = name; this.code = code; } .... } Connection con = null; CallableStatement cstmt = null; try { con = OracleConnection.getConn(); System.out.println(new Date()); List
orderList = new ArrayList
(); for(int i=0;i<100000;i++){ orderList.add(new PocoTestModel(UUID.randomUUID().toString(),"name"+i,"code"+i)); } ArrayDescriptor tabDesc = ArrayDescriptor.createDescriptor("poco_test_object_arr_type", con); ARRAY vArray = new ARRAY(tabDesc, con, orderList.toArray()); cstmt = con.prepareCall("{call poco_test_arr_pro(?)}"); cstmt.setArray(1, vArray); cstmt.execute(); con.commit(); }catch ...
上面是所查到的Oracle批量插入的资料,关于
C++
方面,没有找到像JDBC类似的方法,提供数组类型的参数的存储过程的调用。下篇文章将介绍另外一个方案,来完成Oracle数据的批量插入。
首页
上一页
1
2
下一页
尾页
2
/2/2