Girish Mahajan (Editor)

OCILIB

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Vincent Rogier

Operating system
  
Cross-platform

License
  
Apache Version 2.0

Written in
  
C, C++

Type
  
API

Stable release
  
4.3.2 / February 8, 2017; 38 days ago (2017-02-08)

OCILIB is an open source and cross platform Oracle C and C++ library that delivers fast and reliable access to Oracle databases.

Contents

The OCILIB library:

  • offers a rich, full featured and easy to use C API
  • runs on all Oracle platforms
  • is written in pure ISO C code with native ISO C Unicode support
  • provides also a C++ API written in standard C++03
  • encapsulates OCI (Oracle Call Interface)
  • is the most complete available OCI wrapper
  • OCILIB is used in applications and database layers written in various languages such as C, C++, Objective-C, D, Rust, Go, Swift, Haskell, Erlang, Lisp, PureBasic, Blitz BASIC, Racket and others.

    Compatibilities

    OCILIB runs on any 32 bits and 64 bits platform having an ISO C compliant compiler and supported by Oracle.
    The C++ API is pure ISO C++03 and compiles with any C++03 compliant compiler.

    Here is the lists of validated configurations.

    Platforms

  • Windows
  • Unix (AIX, HP-UX, Linux)
  • Mac OS X
  • Solaris
  • Validated C Compilers

  • Microsoft C compiler
  • GCC, MinGW
  • IBM XL C
  • Intel compilers
  • LabView
  • TCC
  • Various CCs
  • OCILIB C API shall compile with any C99 compliant compiler

    Validated C++ Compilers

  • Microsoft C++ compiler
  • G++
  • CLang
  • OCILIB C++ API shall compile with any C++03 compliant compiler

    Library

  • Pure ISO C API
  • Pure ISO C++ API
  • Easy API (JDBC's like)
  • Cross platform
  • Compatible with all Oracle versions >= 8i
  • Full Unicode support (UTF-8 and UTF-16)
  • Supports static / shared oracle linkage
  • Supports runtime loading of Oracle shared libraries
  • Error handling (global and thread contextual)
  • Small memory usage
  • Datatypes

    OCILIB supports all Oracle SQL and PL/SQL datatypes :

  • Scalar types : CHAR, VARCHAR, VARCHAR2, NUMBER, FLOAT, ...
  • binary types : RAW, LONG RAW, VARRAW, ..
  • Larges objects : BLOB, CLOB, NCLOB, BFILE, CFILE
  • LONG types: LONG, VAR LONG, ...
  • Date, Timestamps and Intervals : DATE, TIMESTAMP, INTERVAL
  • PL/SQL types : Ref cursors, PL/SQL Tables
  • Objects (Named Types) and Objects references (REFs)
  • SQL Collections : VARRAYs and Nested Tables
  • ROWIDs and UROWIDs
  • Features

  • Easy and complete API providing more than 600 functions
  • Full support for OCI relational API
  • Full support for OCI object API
  • Host variable binding
  • Array interface binding and batch errors handling
  • Oracle connection and session pools
  • Scrollable cursors
  • Direct Path loading
  • Oracle Advanced Queues(Oracle AQ)
  • Oracle XA connectivity (X/Open Distributed Transaction Processing XA interface)
  • Oracle TAF (Transparent Application Fail-over) and HA (High availability) support)
  • Oracle SQL "Returning into" DML feature
  • Binding array Interface
  • Scrollable statements
  • Statement cache
  • Startup/shutdown remote Oracle instances
  • Oracle Database Change notification / Continuous Query Notification
  • Oracle warnings support
  • Global transactions
  • Provides Hash tables support
  • Provides portable threads and mutexes API
  • Describe database objects
  • Documentation

  • OCILIB documentation
  • Tutorials

  • Article about OCILIB on www.codeguru.com : "Faster and Friendlier Access to Oracle's OCI API"
  • French Tutorial on www.developpez.com : "Développer une application Oracle en C/C++ avec la librairie OCILIB"
  • Example

    Example of a complete minimal OCILIB application :

    Example of a complete minimal OCILIB application :

    Bindings

  • D: Deimos
  • Go: gocilib
  • Swift: SwiftOracle
  • Erlang:prophet
  • Lisp: cl-oracle
  • Haskell: hocilib
  • PureBasic: RWrappers
  • References

    OCILIB Wikipedia