设为首页 加入收藏

TOP

C++完成Oracle存储过程批量插入(一)(二)
2015-07-20 17:46:11 来源: 作者: 【 】 浏览:4
Tags:完成 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
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇poj 1200 (hash) 下一篇UICollectionView自定义Layout之..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·如何利用Python做数 (2025-12-24 23:48:36)
·如何使用python进行 (2025-12-24 23:48:34)
·python 爬虫入门该怎 (2025-12-24 23:48:31)
·Java 实现多个大文件 (2025-12-24 23:22:00)
·Java多线程编程在工 (2025-12-24 23:21:56)