没有合适的资源?快使用搜索试试~ 我知道了~
首页Oracle C++ Call Interface Programmer's Guide 12c Release 2
Oracle C++ Call Interface Programmer's Guide 12c Release 2
需积分: 9 6 下载量 183 浏览量
更新于2024-07-20
收藏 3.5MB PDF 举报
"Oracle C++ Call Interface 是Oracle公司提供的一个C++接口,允许开发者使用C++语言直接访问和操作Oracle数据库。这个接口提供了丰富的类库和方法,使得在C++程序中执行SQL语句、管理数据库连接、处理结果集等任务变得更加方便。Oracle C++ Call Interface (OCCI) 是Oracle数据库客户端开发的重要工具,适用于开发高性能、数据库密集型的应用程序。"
Oracle C++ Call Interface (OCCI) 是Oracle数据库与C++应用程序之间的桥梁,它为C++程序员提供了一套完整的API,用于进行数据库交互。在12c Release 2 (12.2) 版本中,OCCI提供了以下关键知识点:
1. **连接管理**:OCCI提供了`Oracle::Connection`类来创建、管理和断开与Oracle数据库的连接。开发者可以使用用户名、密码和数据库服务名来建立连接,并通过调用`commit()`和`rollback()`方法进行事务控制。
2. **SQL执行**:通过`Oracle::Statement`类,开发者可以准备、执行SQL语句和PL/SQL块。`execute()`方法用于执行非查询SQL,而`executeQuery()`用于执行查询。`getResultSet()`方法则用于获取查询的结果集。
3. **结果集处理**:`Oracle::ResultSet`类提供了遍历和操作查询结果的方法。开发者可以使用`next()`方法移动到结果集中下一行,`getXXX()`方法(如`getNumber()`, `getString()`, `getDate()`等)用于获取列数据。
4. **游标和批处理**:OCCI支持游标(也称为指针)的概念,允许在单个会话中多次提取结果集的一部分。此外,还可以使用`addBatch()`方法实现SQL批处理,提高数据库操作的效率。
5. **异常处理**:OCCI遵循C++的异常处理机制,当发生错误时,会抛出`SQLException`异常。通过捕获这些异常,开发者可以对数据库操作中的错误进行适当的处理。
6. **类型映射**:OCCI将Oracle数据库的类型映射为C++的类型,例如,Oracle的NUMBER类型映射为C++的`long`或`double`,VARCHAR2映射为`std::string`,DATE映射为`Oracle::Date`对象。
7. **对象关系映射(ORM)**:虽然OCCI本身不直接支持ORM,但开发者可以利用其底层功能构建自己的ORM框架,将数据库对象映射为C++的类和对象。
8. **连接池**:为了优化性能和资源管理,OCCI支持连接池的概念。通过`Oracle::Pool`类,开发者可以创建和管理一组预分配的数据库连接,从而减少频繁连接和断开的开销。
9. **安全性**:OCCI提供了对数据库安全特性的访问,包括角色切换、权限管理等,允许开发者在应用程序级别实现安全策略。
10. **性能优化**:OCCI提供了多种方法来提升性能,如使用绑定变量、批处理操作、预编译的语句等。这些技术有助于减少网络传输、提高SQL执行速度并降低解析开销。
Oracle C++ Call Interface 提供了丰富的功能,让C++开发者能够充分利用Oracle数据库的强大功能,同时保持C++代码的清晰和高效。通过深入理解和熟练使用OCCI,开发者可以构建高效、健壮且易于维护的数据库应用程序。
13.15.13 operator==() .............................................................................................................. 13-109
13.15.14 operator!=()................................................................................................................ 13-109
13.15.15 operator/()................................................................................................................. 13-109
13.15.16 operator/=() .............................................................................................................. 13-110
13.15.17 operator>()................................................................................................................. 13-110
13.15.18 operator>=() .............................................................................................................. 13-110
13.15.19 operator<()................................................................................................................. 13-111
13.15.20 operator<=() .............................................................................................................. 13-111
13.15.21 operator-().................................................................................................................. 13-111
13.15.22 operator-=() ............................................................................................................... 13-112
13.15.23 operator+()................................................................................................................. 13-112
13.15.24 operator+=() .............................................................................................................. 13-112
13.15.25 set() ............................................................................................................................. 13-113
13.15.26 setNull() ..................................................................................................................... 13-113
13.15.27 toText() ....................................................................................................................... 13-113
13.15.28 toUText().................................................................................................................... 13-114
13.16 IntervalYM Class.................................................................................................................... 13-114
13.16.1 IntervalYM()................................................................................................................ 13-116
13.16.2 fromText().................................................................................................................... 13-117
13.16.3 fromUText()................................................................................................................. 13-117
13.16.4 getMonth()................................................................................................................... 13-118
13.16.5 getYear()....................................................................................................................... 13-118
13.16.6 isNull() ......................................................................................................................... 13-118
13.16.7 operator*().................................................................................................................... 13-118
13.16.8 operator*=() ................................................................................................................. 13-118
13.16.9 operator=()................................................................................................................... 13-119
13.16.10 operator==() .............................................................................................................. 13-119
13.16.11 operator!=()................................................................................................................ 13-119
13.16.12 operator/()................................................................................................................. 13-120
13.16.13 operator/=() .............................................................................................................. 13-120
13.16.14 operator>()................................................................................................................. 13-120
13.16.15 operator>=() .............................................................................................................. 13-121
13.16.16 operator<()................................................................................................................. 13-121
13.16.17 operator<=() .............................................................................................................. 13-121
13.16.18 operator-().................................................................................................................. 13-122
13.16.19 operator-=() ............................................................................................................... 13-122
13.16.20 operator+()................................................................................................................. 13-122
13.16.21 operator+=() .............................................................................................................. 13-123
13.16.22 set() ............................................................................................................................. 13-123
13.16.23 setNull() ..................................................................................................................... 13-123
13.16.24 toText() ....................................................................................................................... 13-123
13.16.25 toUText().................................................................................................................... 13-124
13.17 Listener Class.......................................................................................................................... 13-124
xvi
13.17.1 Listener()...................................................................................................................... 13-124
13.17.2 getAgentList() ............................................................................................................. 13-125
13.17.3 getTimeOutForListen() .............................................................................................. 13-125
13.17.4 listen()........................................................................................................................... 13-125
13.17.5 setAgentList().............................................................................................................. 13-126
13.17.6 setTimeOutForListen()............................................................................................... 13-126
13.18 Map Class................................................................................................................................ 13-126
13.18.1 put() .............................................................................................................................. 13-127
13.19 Message Class......................................................................................................................... 13-127
13.19.1 Message()..................................................................................................................... 13-129
13.19.2 getAnyData()............................................................................................................... 13-129
13.19.3 getAttemptsToDequeue().......................................................................................... 13-130
13.19.4 getBytes() ..................................................................................................................... 13-130
13.19.5 getCorrelationId()....................................................................................................... 13-130
13.19.6 getDelay() .................................................................................................................... 13-130
13.19.7 getExceptionQueueName()....................................................................................... 13-130
13.19.8 getExpiration() ............................................................................................................ 13-130
13.19.9 getMessageEnqueuedTime() .................................................................................... 13-131
13.19.10 getMessageState()..................................................................................................... 13-131
13.19.11 getObject().................................................................................................................. 13-131
13.19.12 getOriginalMessageId()........................................................................................... 13-131
13.19.13 getPayloadType() ..................................................................................................... 13-131
13.19.14 getPriority() ............................................................................................................... 13-131
13.19.15 getSenderId()............................................................................................................. 13-131
13.19.16 isNull() ....................................................................................................................... 13-132
13.19.17 operator=()................................................................................................................. 13-132
13.19.18 setAnyData() ............................................................................................................. 13-132
13.19.19 setBytes().................................................................................................................... 13-132
13.19.20 setCorrelationId() ..................................................................................................... 13-133
13.19.21 setDelay()................................................................................................................... 13-133
13.19.22 setExceptionQueueName() ..................................................................................... 13-133
13.19.23 setExpiration()........................................................................................................... 13-134
13.19.24 setNull() ..................................................................................................................... 13-134
13.19.25 setObject() .................................................................................................................. 13-134
13.19.26 setOriginalMessageId()............................................................................................ 13-134
13.19.27 setPriority()................................................................................................................ 13-135
13.19.28 setRecipientList() ...................................................................................................... 13-135
13.19.29 setSenderId() ............................................................................................................. 13-135
13.20 MetaData Class....................................................................................................................... 13-136
13.20.1 MetaData()................................................................................................................... 13-144
13.20.2 getAttributeCount() ................................................................................................... 13-144
13.20.3 getAttributeId()........................................................................................................... 13-144
13.20.4 getAttributeType() ..................................................................................................... 13-145
xvii
13.20.5 getBoolean()................................................................................................................. 13-145
13.20.6 getInt().......................................................................................................................... 13-145
13.20.7 getMetaData() ............................................................................................................. 13-146
13.20.8 getNumber()................................................................................................................ 13-146
13.20.9 getRef()......................................................................................................................... 13-146
13.20.10 getString() .................................................................................................................. 13-147
13.20.11 getTimeStamp() ........................................................................................................ 13-147
13.20.12 getUInt()..................................................................................................................... 13-147
13.20.13 getUString()............................................................................................................... 13-148
13.20.14 getVector() ................................................................................................................. 13-148
13.20.15 operator=()................................................................................................................. 13-148
13.21 NotifyResult Class ................................................................................................................. 13-148
13.21.1 getConsumerName().................................................................................................. 13-149
13.21.2 getMessage()................................................................................................................ 13-149
13.21.3 getMessageId()............................................................................................................ 13-149
13.21.4 getPayload() ................................................................................................................ 13-149
13.21.5 getQueueName() ........................................................................................................ 13-149
13.22 Number Class......................................................................................................................... 13-149
13.22.1 Number() ..................................................................................................................... 13-153
13.22.2 abs() .............................................................................................................................. 13-154
13.22.3 arcCos() ........................................................................................................................ 13-155
13.22.4 arcSin() ......................................................................................................................... 13-155
13.22.5 arcTan() ........................................................................................................................ 13-155
13.22.6 arcTan2() ...................................................................................................................... 13-155
13.22.7 ceil() .............................................................................................................................. 13-155
13.22.8 cos()............................................................................................................................... 13-155
13.22.9 exp().............................................................................................................................. 13-156
13.22.10 floor().......................................................................................................................... 13-156
13.22.11 fromBytes() ................................................................................................................ 13-156
13.22.12 fromText().................................................................................................................. 13-156
13.22.13 hypCos()..................................................................................................................... 13-157
13.22.14 hypSin()...................................................................................................................... 13-157
13.22.15 hypTan()..................................................................................................................... 13-157
13.22.16 intPower() .................................................................................................................. 13-157
13.22.17 isNull() ....................................................................................................................... 13-158
13.22.18 ln()............................................................................................................................... 13-158
13.22.19 log()............................................................................................................................. 13-158
13.22.20 operator++() .............................................................................................................. 13-158
13.22.21 operator--() ................................................................................................................ 13-159
13.22.22 operator*().................................................................................................................. 13-159
13.22.23 operator/()................................................................................................................. 13-159
13.22.24 operator%()................................................................................................................ 13-160
13.22.25 operator+()................................................................................................................. 13-160
xviii
13.22.26 operator-().................................................................................................................. 13-160
13.22.27 operator-().................................................................................................................. 13-161
13.22.28 operator<()................................................................................................................. 13-161
13.22.29 operator<=() .............................................................................................................. 13-161
13.22.30 operator>()................................................................................................................. 13-162
13.22.31 operator>=() .............................................................................................................. 13-162
13.22.32 operator==() .............................................................................................................. 13-163
13.22.33 operator!=()................................................................................................................ 13-163
13.22.34 operator=()................................................................................................................. 13-163
13.22.35 operator*=() ............................................................................................................... 13-164
13.22.36 operator/=() .............................................................................................................. 13-164
13.22.37 operator%=() ............................................................................................................. 13-164
13.22.38 operator+=() .............................................................................................................. 13-164
13.22.39 operator-=() ............................................................................................................... 13-165
13.22.40 operator char() .......................................................................................................... 13-165
13.22.41 operator signed char().............................................................................................. 13-165
13.22.42 operator double()...................................................................................................... 13-165
13.22.43 operator float() .......................................................................................................... 13-165
13.22.44 operator int() ............................................................................................................. 13-166
13.22.45 operator long() .......................................................................................................... 13-166
13.22.46 operator long double()............................................................................................. 13-166
13.22.47 operator short()......................................................................................................... 13-166
13.22.48 operator unsigned char()......................................................................................... 13-166
13.22.49 operator unsigned int()............................................................................................ 13-166
13.22.50 operator unsigned long()......................................................................................... 13-167
13.22.51 operator unsigned short() ....................................................................................... 13-167
13.22.52 power()....................................................................................................................... 13-167
13.22.53 prec()........................................................................................................................... 13-167
13.22.54 round() ....................................................................................................................... 13-167
13.22.55 setNull() ..................................................................................................................... 13-168
13.22.56 shift() .......................................................................................................................... 13-168
13.22.57 sign()........................................................................................................................... 13-168
13.22.58 sin() ............................................................................................................................. 13-168
13.22.59 squareroot() ............................................................................................................... 13-168
13.22.60 tan()............................................................................................................................. 13-169
13.22.61 toBytes() ..................................................................................................................... 13-169
13.22.62 toText() ....................................................................................................................... 13-169
13.22.63 trunc()......................................................................................................................... 13-170
13.23 PObject Class .......................................................................................................................... 13-170
13.23.1 PObject()....................................................................................................................... 13-171
13.23.2 flush() ........................................................................................................................... 13-172
13.23.3 getConnection() .......................................................................................................... 13-172
13.23.4 getRef()......................................................................................................................... 13-172
xix
13.23.5 getSQLTypeName() ................................................................................................... 13-172
13.23.6 isLocked() .................................................................................................................... 13-172
13.23.7 isNull() ......................................................................................................................... 13-173
13.23.8 lock()............................................................................................................................. 13-173
13.23.9 markDelete()................................................................................................................ 13-173
13.23.10 markModified() ........................................................................................................ 13-173
13.23.11 operator=()................................................................................................................. 13-173
13.23.12 operator delete() ....................................................................................................... 13-174
13.23.13 operator new()........................................................................................................... 13-174
13.23.14 pin() ............................................................................................................................ 13-175
13.23.15 setNull() ..................................................................................................................... 13-175
13.23.16 unmark() .................................................................................................................... 13-175
13.23.17 unpin()........................................................................................................................ 13-175
13.24 Producer Class........................................................................................................................ 13-176
13.24.1 Producer().................................................................................................................... 13-177
13.24.2 getQueueName() ........................................................................................................ 13-177
13.24.3 getRelativeMessageId() ............................................................................................. 13-178
13.24.4 getSequenceDeviation()............................................................................................. 13-178
13.24.5 getTransformation() ................................................................................................... 13-178
13.24.6 getVisibility()............................................................................................................... 13-178
13.24.7 isNull() ......................................................................................................................... 13-178
13.24.8 operator=()................................................................................................................... 13-178
13.24.9 send()............................................................................................................................ 13-179
13.24.10 setNull() ..................................................................................................................... 13-179
13.24.11 setQueueName()....................................................................................................... 13-179
13.24.12 setRelativeMessageId()............................................................................................ 13-180
13.24.13 setSequenceDeviation() ........................................................................................... 13-180
13.24.14 setTransformation().................................................................................................. 13-180
13.24.15 setVisibility() ............................................................................................................. 13-180
13.25 Ref Class.................................................................................................................................. 13-181
13.25.1 Ref() .............................................................................................................................. 13-182
13.25.2 clear()............................................................................................................................ 13-182
13.25.3 getConnection() .......................................................................................................... 13-183
13.25.4 isClear()........................................................................................................................ 13-183
13.25.5 isNull() ......................................................................................................................... 13-183
13.25.6 markDelete()................................................................................................................ 13-183
13.25.7 operator->() ................................................................................................................. 13-183
13.25.8 operator*().................................................................................................................... 13-183
13.25.9 operator==() ................................................................................................................ 13-184
13.25.10 operator!=()................................................................................................................ 13-184
13.25.11 operator=()................................................................................................................. 13-184
13.25.12 ptr()............................................................................................................................. 13-185
13.25.13 setLock()..................................................................................................................... 13-185
xx
剩余561页未读,继续阅读
2013-06-09 上传
2008-07-30 上传
2011-02-21 上传
2013-02-22 上传
2013-07-15 上传
2023-06-18 上传
点击了解资源详情
mengrongqing
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C语言数组操作:高度检查器编程实践
- 基于Swift开发的嘉定单车LBS iOS应用项目解析
- 钗头凤声乐表演的二度创作分析报告
- 分布式数据库特训营全套教程资料
- JavaScript开发者Robert Bindar的博客平台
- MATLAB投影寻踪代码教程及文件解压缩指南
- HTML5拖放实现的RPSLS游戏教程
- HT://Dig引擎接口,Ampoliros开源模块应用
- 全面探测服务器性能与PHP环境的iprober PHP探针v0.024
- 新版提醒应用v2:基于MongoDB的数据存储
- 《我的世界》东方大陆1.12.2材质包深度体验
- Hypercore Promisifier: JavaScript中的回调转换为Promise包装器
- 探索开源项目Artifice:Slyme脚本与技巧游戏
- Matlab机器人学习代码解析与笔记分享
- 查尔默斯大学计算物理作业HP2解析
- GitHub问题管理新工具:GIRA-crx插件介绍
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功