# OCILIB - C and C++ Drivers for Oracle
[![Build Status](https://img.shields.io/travis/vrogier/ocilib/master.svg)](https://travis-ci.org/vrogier/ocilib)
[![Code Analysis](https://img.shields.io/coverity/scan/8019.svg)](https://scan.coverity.com/projects/vrogier-ocilib)
## 1. About
OCILIB is an open source and cross platform Oracle Driver that delivers efficient access to Oracle databases.
The OCILIB library :
- offers a rich, full featured and easy to use API
- runs on all Oracle platforms
- is written in pure ISO C99 code with native ISO C Unicode support
- provides also a C++ API written in standard C++03 with support for some C++11 features
- Enables high productivity
- encapsulates OCI (Oracle Call Interface)
- is the most complete available OCI wrapper
OCILIB is developed by Vincent Rogier. Get the latest package, install and enjoy it!
## 2. License
The source code is free source code licensed under **Apache License, Version 2.0** - see [LICENSE file](LICENSE)
## 3. Features
- ISO C API
- ISO C ++ API
- Full ANSI and Unicode support on all platforms (ISO C wide strings or UTF8 strings)
- Full 32/64 bits compatibility
- Compatible with all Oracle version >= 8.0
- Automatic adaptation to the runtime Oracle client version
- Runtime loading of Oracle libraries
- Built-in error handling (global and thread context)
- Full support for SQL API and Object API
- Full support for ALL Oracle SQL and PL/SQL datatypes (scalars, objects, refs, collections, ..)
- Full support for PL/SQL (blocks, cursors, Index by Tables and Nested tables)
- Support for non scalar datatype with trough library objects
- Oracle Pooling (connections and sessions pools)
- Oracle XA connectivity (X/Open Distributed Transaction Processing XA interface)
- Oracle AQ (Advanced Queues)
- Oracle TAF (Transparent Application Failover) and HA (High availability) support
- Binding array Interface
- Returning DML feature
- Scrollable statements
- Statement cache
- Direct Path loading
- Remote Instances Startup/Shutdown
- Oracle Database Change notification / Continuous Query Notification
- Oracle warnings support
- Global and local transactions
- Describe database schema objects
- Hash tables API
- Portable Threads and mutexes API
## 5. Installation
### Windows platforms
- unzip the archive
- copy ocilib\include\ocilib.h to any place located in your include’s path
- copy ocilib\lib32|64\ocilib[x].lib to any place located in your libraries path
- copy ocilib\lib32|64\ocilib[x].dll to any place located in your windows path
### GNU (Unix / Linux) platforms
- untar the archive
- $ cd ocilib-x.y.z
- $ ./configure
- $ make
- $ make install (you might need to `su` to make install)
Make sure Oracle and OCILIB libraries paths are defined in your shared library environment variable
You need to provide extra configure parameters when using Instant Clients – see Installation section)
## 6. Examples
Example of a minimal OCILIB C application
```C
#include "ocilib.h"
int main(int argc, char *argv[])
{
OCI_Connection* cn;
OCI_Statement* st;
OCI_Resultset* rs;
OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT);
cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
st = OCI_StatementCreate(cn);
OCI_ExecuteStmt(st, "select intcol, strcol from table");
rs = OCI_GetResultset(st);
while (OCI_FetchNext(rs))
{
printf("%i - %s\n", OCI_GetInt(rs, 1), OCI_GetString(rs,2));
}
OCI_Cleanup();
return EXIT_SUCCESS;
}
```
Example of a minimal OCILIB C++ application
```C++
#include "ocilib.hpp"
using namespace ocilib;
int main(void)
{
try
{
Environment::Initialize();
Connection con("db", "usr", "pwd");
Statement st(con);
st.Execute("select intcol, strcol from table");
Resultset rs = st.GetResultset();
while (rs.Next())
{
std::cout << rs.Get<int>(1) << " - " << rs.Get<ostring>(2) << std::endl;
}
}
catch(std::exception &ex)
{
std::cout << ex.what() << std::endl;
}
Environment::Cleanup();
return EXIT_SUCCESS;
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
OCILIB (C and C++ Drivers for Oracle) (356个子文件)
configure.ac 1KB
Makefile.am 4KB
Makefile.am 842B
Makefile.am 706B
Makefile.am 662B
Makefile.am 627B
AUTHORS 255B
statement.c 114KB
ocilib.c 113KB
environment.c 85KB
connection.c 72KB
resultset.c 71KB
object.c 64KB
ocilib_demo.c 59KB
column.c 42KB
bind.c 39KB
dirpath.c 39KB
element.c 38KB
lob.c 36KB
stringutils.c 32KB
timestamp.c 29KB
dequeue.c 28KB
exception.c 27KB
number.c 26KB
message.c 23KB
typeinfo.c 23KB
queue.c 22KB
date.c 21KB
pool.c 21KB
collection.c 20KB
file.c 19KB
interval.c 17KB
callback.c 17KB
hash.c 14KB
dirpath_complete.c 12KB
memory.c 12KB
define.c 12KB
format.c 12KB
error.c 12KB
reference.c 12KB
enqueue.c 11KB
subscription.c 11KB
list.c 11KB
handle.c 9KB
array.c 9KB
long.c 8KB
transaction.c 8KB
database.c 8KB
agent.c 7KB
threadkey.c 7KB
helpers.c 6KB
iterator.c 6KB
thread.c 5KB
number.c 4KB
mutex.c 4KB
notification.c 4KB
event.c 4KB
geometry.c 3KB
queue_async.c 3KB
dirpath.c 3KB
long.c 2KB
file.c 2KB
coll.c 2KB
object.c 2KB
queue.c 2KB
plsql_table.c 2KB
scroll.c 2KB
hash.c 2KB
super_types.c 2KB
ref.c 2KB
array.c 1KB
lob.c 1KB
format.c 1KB
fetch_struct.c 1KB
main.c 1KB
date.c 1KB
pool.c 1KB
implicit_resultset.c 1KB
returning.c 1KB
abort.c 1KB
desc.c 1KB
thread.c 1KB
rowid.c 1KB
array_internal.c 1KB
cursor.c 999B
bind.c 986B
timestamp.c 976B
output.c 951B
exec.c 923B
meta.c 872B
fetch.c 851B
instance.c 841B
conn.c 740B
plsql_block.c 728B
err_warning.c 584B
err.c 580B
err_ctx.c 504B
ocilib_static_lib_mingw.cbp 5KB
ocilib_demo_codeblocks.cbp 2KB
ocilib++_demo_codeblocks.cbp 2KB
共 356 条
- 1
- 2
- 3
- 4
资源评论
暮苍梧~
- 粉丝: 41
- 资源: 258
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功