Oracle C++ Call Interface
外观
此條目需要擴充。 (2018年4月15日) |

維基教科書中的相關電子教程:Oracle C++ Call Interface(OCCI)
Oracle C++ Call Interface (OCCI),是Oracle公司提供的C++程序访问Oracle数据库的API[1] OCCI的类提供了SQL语句的参数。OCCI从Oracle数据库9i开始发布。
OCCI起源自Oracle Call Interface (OCI),C语言程序的API。[2]
简介
安装
OCCI现在包含于oracle客户端包中。只需从Oracle网站下载相应版本的Instant Client包解压即可。[3]
Easy Connect 字符串的格式为:
[//]host_name[:port][/service_name][:server_type][/instance_name]
Oracle Instant Client向后兼容访问低版本的数据库。
获取std::string类型的字段的值的结果集成员函数getString()在Visual C++编译后运行时,常会报异常,这需要根据访问的Oracle数据库的版本从Oracle网站下载使用相应版本号的“Instant Client Downloads for Microsoft Windows 32-bit”[4]。并选择相应的调试版本的库:
- DLL multithread Debug (/MDd) for debug with oraocci11d.lib and oraocci11d.dll
- DLL multithread (/MD) for release with oraocci11.lib and oraocci11.dll
并且采取静态局部变量接收成员函数getString()的返回值,形如:
static std::string varName = resultSet->getString(1);