OCILIB (C and C++ Drivers for Oracle) - Open source C and C++ library for accessing Oracle databases
C C++ Shell Makefile Other
Permalink
Failed to load latest commit information.
config Updated autotools to latest version Feb 20, 2016
demo Extended C API demo app for OCI_Number Feb 7, 2017
doc/html Update misc files for 4.3. release Aug 1, 2016
doxygen Updated package files for release 4.3.2 Feb 8, 2017
images Fixed Doxygen project file Jun 3, 2014
include fix #79 Feb 8, 2017
m4 Updated autotools to latest version Feb 20, 2016
proj Added VS2015 solutions for demos Feb 4, 2017
src Fix coverity static code analysis warning Feb 8, 2017
.gitattributes removed '* text=auto' as commit diffs become unreadable due to LF con… Jun 25, 2015
.gitignore Updated git ignore file with some VS temp file extensions Feb 4, 2017
.travis.yml Temporarily disabled clang and osx travis CI builds Jan 21, 2017
AUTHORS Update AUTHORS Jan 22, 2016
COPYING Relicensing OCILIB to Apache License 2.0 Mar 14, 2016
ChangeLog Updated package files for release 4.3.2 Feb 8, 2017
ChangeLog.txt Updated package files for release 4.3.2 Feb 8, 2017
INSTALL update autotools files Feb 20, 2016
Makefile.am Update misc files for 4.3. release Aug 1, 2016
Makefile.in Update misc files for 4.3. release Aug 1, 2016
NEWS Misc non code update for 4.2.1. release (licensing and references) Mar 18, 2016
README Misc non code update for 4.2.1. release (licensing and references) Mar 18, 2016
README.MD Update README.MD Sep 23, 2016
README.in Misc non code update for 4.2.1. release (licensing and references) Mar 18, 2016
Readme.txt updating version information for 4.3.2 release Feb 3, 2017
THANKS Update THANKS Jan 22, 2016
Thanks.txt Misc : Updaed doxygen config file Jun 12, 2014
VERSION updating version information for 4.3.2 release Feb 3, 2017
aclocal.m4 Updated autotools to latest version Feb 20, 2016
acocilib.m4 Demo SQL files where not deployed by make install Oct 4, 2016
config.h.in Updated autotools to latest version Feb 20, 2016
configure update autotools files Feb 20, 2016
configure.ac Update misc files for 4.3. release Aug 1, 2016
license.txt Relicensing OCILIB to Apache License 2.0 Mar 14, 2016
ocilib.pc.in removed references to sourceforge.net Jun 22, 2015
reconf Updated copyrigth Mar 14, 2016

README.MD

OCILIB - C and C++ Drivers for Oracle

Build Status Code Analysis

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 isn standard C++ 3 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

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
  • Comptabile with all Oracle version >= 8i
  • Automatic adaptation to the runtime Oracle client version
  • Runtime loading of Oracle libraries
  • Builtin 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 (Advanded Queues)
  • Oracle TAF (Transparent Application Failover) and HA (High availabality) 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

#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

#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;
}