没有合适的资源?快使用搜索试试~ 我知道了~
首页Oracle C++与VS2010数据库开发教程
Oracle C++与VS2010数据库开发教程
需积分: 10 0 下载量 45 浏览量
更新于2024-07-27
收藏 3.32MB PDF 举报
"C++LinkDataBase 是一份基于Visual Studio 2010的教程,专注于讲解如何使用C++与Oracle数据库进行交互。这份教材是开发者案头的重要参考资料,适合学习C++数据库编程,尤其是针对Oracle数据库的窗体应用程序开发。"
在C++中链接和操作Oracle数据库,通常会用到Oracle提供的C++接口——Oracle C++ Call Interface (OCCI),这是Oracle数据库的一个客户端API,允许开发者使用C++语言编写高效且直接的数据访问应用。OCCI提供了对Oracle数据库的全面访问,包括查询、事务处理、游标操作等功能。
Oracle C++ Call Interface Programmer's Guide 11g Release 1 (11.1)是官方文档,详细介绍了OCCI的使用方法和API。该文档由Roza Leyderman作为主要作者,多个贡献者共同编撰完成,包含了丰富的示例代码和最佳实践。这份指南覆盖了以下关键知识点:
1. **安装和配置**:首先,你需要安装Oracle Client库,确保开发环境中包含必要的OCCI头文件和库文件,设置环境变量以指向正确的库路径。
2. **连接管理**:学习如何创建和管理数据库连接,包括建立连接(`OCISession`对象)、设置连接属性(如用户、密码、数据库服务名)以及断开连接。
3. **SQL执行**:使用OCCI执行SQL语句,包括简单查询、DML操作(插入、更新、删除)以及存储过程调用。
4. **游标操作**:通过`OCICursor`对象,你可以控制游标并逐行获取查询结果。这涉及打开、移动和关闭游标,以及提取数据到C++对象。
5. **事务处理**:理解如何在C++代码中管理事务,包括开始、提交、回滚以及设置事务隔离级别。
6. **异常处理**:学习OCCI的异常处理机制,如何捕获和处理数据库操作中可能出现的错误。
7. **对象关系映射(ORM)**:虽然OCCI不直接提供ORM功能,但你可以构建自己的解决方案,将数据库表映射到C++类,简化数据访问。
8. **性能优化**:了解如何使用预编译语句(`OCIPrepare`)提高执行效率,以及缓存绑定变量等高级特性。
9. **安全性和连接池**:理解如何在应用程序中实现安全的最佳实践,包括使用连接池来管理多个数据库会话,提高资源利用率。
10. **兼容性和互操作性**:学习如何使你的OCCI程序与其他独立创建的软件实现互操作,如在需要时进行反汇编或反编译以满足特定需求。
这份教材和OCCI指南是C++开发者在Oracle数据库开发中的宝贵资源,通过深入学习和实践,你可以熟练掌握C++与Oracle数据库之间的通信,构建高效稳定的数据驱动应用。
xvi
lastDay().......................................................................................................................................... 13-80
nextDay() ........................................................................................................................................ 13-80
operator=() ..................................................................................................................................... 13-81
operator==()................................................................................................................................... 13-81
operator!=() .................................................................................................................................... 13-81
operator>() ..................................................................................................................................... 13-82
operator>=()................................................................................................................................... 13-82
operator<() ..................................................................................................................................... 13-82
operator<=()................................................................................................................................... 13-83
setDate().......................................................................................................................................... 13-83
setNull() .......................................................................................................................................... 13-83
toBytes().......................................................................................................................................... 13-84
toText()............................................................................................................................................ 13-84
toZone() .......................................................................................................................................... 13-84
Environment Class .............................................................................................................................. 13-86
createConnection() ....................................................................................................................... 13-87
createConnectionPool() ................................................................................................................ 13-88
createEnvironment() .................................................................................................................... 13-89
createStatelessConnectionPool() ................................................................................................. 13-90
enableSubscription() ..................................................................................................................... 13-91
disableSubscription() .................................................................................................................... 13-91
getCacheMaxSize()........................................................................................................................ 13-91
getCacheOptSize()......................................................................................................................... 13-91
getCacheSortedFlush() ................................................................................................................. 13-92
getCurrentHeapSize()................................................................................................................... 13-92
getLDAPAdminContext()............................................................................................................ 13-92
getLDAPAuthentication()............................................................................................................ 13-92
getLDAPHost().............................................................................................................................. 13-92
getLDAPPort()............................................................................................................................... 13-92
getMap() ......................................................................................................................................... 13-92
getOCIEnvironment()................................................................................................................... 13-93
getXAConnection() ....................................................................................................................... 13-93
getXAEnvironment() .................................................................................................................... 13-93
releaseXAConnection()..........................................................................................................
....... 13-93
releaseXAEnvironment().............................................................................................................. 13-94
setCacheMaxSize() ........................................................................................................................ 13-94
setCacheOptSize() ......................................................................................................................... 13-94
setCacheSortedFlush().................................................................................................................. 13-94
setLDAPAdminContext()............................................................................................................. 13-95
setLDAPAuthentication() ............................................................................................................ 13-95
setLDAPHostAndPort() ............................................................................................................... 13-95
setLDAPLoginNameAndPassword()......................................................................................... 13-96
terminateConnection().................................................................................................................. 13-96
terminateConnectionPool().......................................................................................................... 13-96
terminateEnvironment()............................................................................................................... 13-96
terminateStatelessConnectionPool()........................................................................................... 13-97
IntervalDS Class.................................................................................................................................. 13-98
xvii
IntervalDS().................................................................................................................................. 13-100
fromText()..................................................................................................................................... 13-100
fromUText().................................................................................................................................. 13-101
getDay() ........................................................................................................................................ 13-101
getFracSec() .................................................................................................................................. 13-101
getHour() ...................................................................................................................................... 13-101
getMinute()................................................................................................................................... 13-101
getSecond()................................................................................................................................... 13-102
isNull() .......................................................................................................................................... 13-102
operator*() .................................................................................................................................... 13-102
operator*=().................................................................................................................................. 13-102
operator=() ................................................................................................................................... 13-102
operator==() ................................................................................................................................. 13-103
operator!=() .................................................................................................................................. 13-103
operator/() ................................................................................................................................... 13-103
operator/=() ................................................................................................................................. 13-104
operator>() ................................................................................................................................... 13-104
operator>=() ................................................................................................................................. 13-104
operator<() ................................................................................................................................... 13-104
operator<=() ................................................................................................................................. 13-105
operator-()..................................................................................................................................... 13-105
operator-=() ................................................................................................................................. 13-105
operator+() ................................................................................................................................... 13-106
operator+=() ................................................................................................................................. 13-106
set() ................................................................................................................................................ 13-106
setNull()........................................................................................................................................ 13-107
toText().......................................................................................................................................... 13-107
toUText()....................................................................................................................................... 13-107
IntervalYM Class............................................................................................................................... 13-108
IntervalYM()................................................................................................................................. 13-109
fromText()..................................................................................................................................... 13-110
fromUText().................................................................................................................................. 13-110
getMonth()....................................................................................................................................
13-111
getYear() ....................................................................................................................................... 13-111
isNull() .......................................................................................................................................... 13-111
operator*() .................................................................................................................................... 13-111
operator*=().................................................................................................................................. 13-111
operator=() ................................................................................................................................... 13-112
operator==() ................................................................................................................................. 13-112
operator!=() .................................................................................................................................. 13-112
operator/() ................................................................................................................................... 13-112
operator/=() ................................................................................................................................. 13-113
operator>() ................................................................................................................................... 13-113
operator>=() ................................................................................................................................. 13-113
operator<() ................................................................................................................................... 13-114
operator<=() ................................................................................................................................. 13-114
operator-()..................................................................................................................................... 13-114
xviii
operator-=() ................................................................................................................................. 13-115
operator+() ................................................................................................................................... 13-115
operator+=()................................................................................................................................. 13-115
set() ................................................................................................................................................ 13-115
setNull() ........................................................................................................................................ 13-116
toText().......................................................................................................................................... 13-116
toUText()....................................................................................................................................... 13-116
Listener Class ..................................................................................................................................... 13-117
Listener()....................................................................................................................................... 13-117
getAgentList() .............................................................................................................................. 13-117
getTimeOutForListen()............................................................................................................... 13-118
listen() ........................................................................................................................................... 13-118
setAgentList()............................................................................................................................... 13-118
setTimeOutForListen() ............................................................................................................... 13-118
Map Class............................................................................................................................................ 13-119
put()............................................................................................................................................... 13-119
Message Class .................................................................................................................................... 13-120
Message()...................................................................................................................................... 13-121
getAnyData()................................................................................................................................ 13-121
getAttemptsToDequeue() .......................................................................................................... 13-122
getBytes()...................................................................................................................................... 13-122
getCorrelationId()........................................................................................................................ 13-122
getDelay() ..................................................................................................................................... 13-122
getExceptionQueueName() ....................................................................................................... 13-122
getExpiration()............................................................................................................................. 13-122
getMessageEnqueuedTime() ..................................................................................................... 13-123
getMessageState()........................................................................................................................ 13-123
getObject() .................................................................................................................................... 13-123
getOriginalMessageId().............................................................................................................. 13-123
getPayloadType() ........................................................................................................................ 13-123
getPriority().................................................................................................................................. 13-123
getSenderId() ............................................................................................................................... 13-124
isNull() .......................................................................................................................................... 13-124
operator=() ................................................................................................................................... 13-124
setAnyData() ................................................................................................................................ 13-124
setBytes()....................................................................................................................................... 13-124
setCorrelationId()........................................................................................................................ 13-125
setDelay()...................................................................................................................................... 13-125
setExceptionQueueName()........................................................................................................ 13-125
setExpiration() ............................................................................................................................. 13-126
setNull() ........................................................................................................................................ 13-126
setObject()..................................................................................................................................... 13-126
setOriginalMessageId() .............................................................................................................. 13-126
setPriority() .................................................................................................................................. 13-127
setRecipientList()......................................................................................................................... 13-127
setSenderId()................................................................................................................................ 13-127
MetaData Class .................................................................................................................................. 13-128
xix
MetaData().................................................................................................................................... 13-137
getAttributeCount() .................................................................................................................... 13-137
getAttributeId() ........................................................................................................................... 13-137
getAttributeType() ...................................................................................................................... 13-137
getBoolean() ................................................................................................................................. 13-138
getInt()........................................................................................................................................... 13-138
getMetaData() .............................................................................................................................. 13-138
getNumber()................................................................................................................................. 13-139
getRef().......................................................................................................................................... 13-139
getString()..................................................................................................................................... 13-139
getTimeStamp() ........................................................................................................................... 13-139
getUInt() ....................................................................................................................................... 13-140
getUString().................................................................................................................................. 13-140
getVector().................................................................................................................................... 13-140
operator=() ................................................................................................................................... 13-140
NotifyResult Class ............................................................................................................................ 13-142
getConsumerName() .................................................................................................................. 13-142
getMessage() ................................................................................................................................ 13-142
getMessageId()............................................................................................................................. 13-142
getPayload() ................................................................................................................................. 13-142
getQueueName()......................................................................................................................... 13-142
Number Class..................................................................................................................................... 13-143
Number() ...................................................................................................................................... 13-146
abs() ............................................................................................................................................... 13-147
arcCos()......................................................................................................................................... 13-147
arcSin() .......................................................................................................................................... 13-147
arcTan()......................................................................................................................................... 13-147
arcTan2()....................................................................................................................................... 13-148
ceil()............................................................................................................................................... 13-148
cos() ............................................................................................................................................... 13-148
exp()............................................................................................................................................... 13-148
floor()............................................................................................................................................. 13-148
fromBytes()................................................................................................................................... 13-148
fromText().....................................................................................................................
................ 13-149
hypCos() ....................................................................................................................................... 13-149
hypSin() ........................................................................................................................................ 13-150
hypTan() ....................................................................................................................................... 13-150
intPower()..................................................................................................................................... 13-150
isNull() .......................................................................................................................................... 13-150
ln().................................................................................................................................................. 13-150
log() ............................................................................................................................................... 13-150
operator++() ................................................................................................................................. 13-151
operator--() ................................................................................................................................. 13-151
operator*() .................................................................................................................................... 13-151
operator/() ................................................................................................................................... 13-152
operator%() .................................................................................................................................. 13-152
operator+() ................................................................................................................................... 13-152
xx
operator-()..................................................................................................................................... 13-152
operator-()..................................................................................................................................... 13-153
operator<() ................................................................................................................................... 13-153
operator<=()................................................................................................................................. 13-153
operator>() ................................................................................................................................... 13-154
operator>=()................................................................................................................................. 13-154
operator==()................................................................................................................................. 13-154
operator!=() .................................................................................................................................. 13-155
operator=() ................................................................................................................................... 13-155
operator*=().................................................................................................................................. 13-155
operator/=()................................................................................................................................. 13-155
operator%=() ................................................................................................................................ 13-156
operator+=()................................................................................................................................. 13-156
operator-=() ................................................................................................................................. 13-156
operator char() ............................................................................................................................. 13-156
operator signed char() ................................................................................................................ 13-157
operator double()......................................................................................................................... 13-157
operator float()............................................................................................................................. 13-157
operator int() ................................................................................................................................ 13-157
operator long()............................................................................................................................. 13-157
operator long double()................................................................................................................ 13-157
operator short()............................................................................................................................ 13-158
operator unsigned char()............................................................................................................ 13-158
operator unsigned int()............................................................................................................... 13-158
operator unsigned long() ........................................................................................................... 13-158
operator unsigned short() .......................................................................................................... 13-158
power().......................................................................................................................................... 13-158
prec() ............................................................................................................................................. 13-159
round() .......................................................................................................................................... 13-159
setNull() ........................................................................................................................................ 13-159
shift() ............................................................................................................................................. 13-159
sign().............................................................................................................................................. 13-160
sin()................................................................................................................................................ 13-160
squareroot().................................................................................................................................. 13-160
tan() ............................................................................................................................................... 13-160
toBytes()........................................................................................................................................ 13-160
toText().......................................................................................................................................... 13-160
trunc()............................................................................................................................................ 13-161
PObject Class ..................................................................................................................................... 13-162
PObject() ....................................................................................................................................... 13-163
flush() ............................................................................................................................................ 13-163
getConnection() ........................................................................................................................... 13-163
getRef().......................................................................................................................................... 13-163
getSQLTypeName() .................................................................................................................... 13-164
isLocked() ..................................................................................................................................... 13-164
isNull() .......................................................................................................................................... 13-164
lock().............................................................................................................................................. 13-164
剩余509页未读,继续阅读
2024-11-19 上传
2024-11-19 上传
2024-11-19 上传
2024-11-19 上传
2024-11-19 上传
2024-11-19 上传
2024-11-19 上传
木子士兵戌女
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 深入浅出:自定义 Grunt 任务的实践指南
- 网络物理突变工具的多点路径规划实现与分析
- multifeed: 实现多作者间的超核心共享与同步技术
- C++商品交易系统实习项目详细要求
- macOS系统Python模块whl包安装教程
- 掌握fullstackJS:构建React框架与快速开发应用
- React-Purify: 实现React组件纯净方法的工具介绍
- deck.js:构建现代HTML演示的JavaScript库
- nunn:现代C++17实现的机器学习库开源项目
- Python安装包 Acquisition-4.12-cp35-cp35m-win_amd64.whl.zip 使用说明
- Amaranthus-tuberculatus基因组分析脚本集
- Ubuntu 12.04下Realtek RTL8821AE驱动的向后移植指南
- 掌握Jest环境下的最新jsdom功能
- CAGI Toolkit:开源Asterisk PBX的AGI应用开发
- MyDropDemo: 体验QGraphicsView的拖放功能
- 远程FPGA平台上的Quartus II17.1 LCD色块闪烁现象解析
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功