OCILIB on twitter !

Hi all,

I’ve created a twitter account for ocilib !

Follow OCILIB on twitter @ocilib

OCILIB valided with Oracle 12c R1

Hi all,

I finally found time for testing OCILIB against Oracle 12c R1 :)

As expected, no problems were found and I’ve added compile and runtime detection of OCI 12cR1.
For the release 4.0.0, some new OCI features introduced in 12cR1 will be supported.

Other ones will be reserved for the release 4.1.0 !

OCILIB 4.0 coming soon !

Hi all,

OCILIB 4.0 is coming soon !

As i mentioned earlier on, this new version introduces a brand new C++ API on top of the OCILIB C API. (see my previous post here).
There are also some minor enhancement in the C API.
I’m still (!!) working on the C++ documentation and fixing final details in the C++ API.

Version 4.0 should be released in October 2013 !

OCILIB C++ API coming soon !

Hello all !

OCILIB C++ API is coming soon !
Thus OCILIB will become a C and C++ driver for Oracle
Code is already available from the OCILIB SVN repository.
It is a single C++ header file that wraps the entire OCILIB C API .
It uses and exposes C++ objects and is based on the standard library and templates.
No usage of new or delete, just objects that automatically handle the lifetime of OCILIB handles :) Automatic and built-in object scope management !
I’m still working on the documentation
C main demo application and various C demos have been ported to C++.

Just have a look and try it :)

here is a basic example :

#include "ocilib.hpp"

using namespace ocilib;

int main(void)
{
    try
    {
        Environment::Initialize();

        Connection con("db", "usr", "pwd");

        Statement st(con);
        st.Execute("select * from products");

        Resultset rs = st.GetResultset();
        while (rs.Next())
        {
            std::cout << "code:" << rs.Get(1) << " name: " <<  rs.Get(2) << std::endl;
        }

        std::cout << "=> Total fetched rows : " << rs.GetCount() << std::endl;

    }
    catch(Exception &ex)
    {
         std::cout << ex.GetMessage() << std::endl;
    }

    Environment::Cleanup();

    return EXIT_SUCCESS;
}

Working on OCILIB C++ support

Hello all,

I finally decided to work on a C++ wrapper around OCILIB !

It will be implemented as a single C++ header file that will offer C++ classes wrapping the OCILIB C API…

If the results sounds good, the next OCILIB release will include this C++ header to simplify C++ developper’s life :)

If any of you are interested, drop me a email !!

Here is an example of my early basic implementation :

#include "ocilib++"

using namespace ocilib;

int main(int argc, char* argv[])
{
    Environment::Initialize(Environment::EnvironmentDefault);

    try
    {
        Connection con("db", "usr", "pwd", Connection::SessionDefault);
        std::cout << con.getServerVersion() << std::endl;

        Statement st(con);
        st.execute("select table_name from user_tables");

        Resultset rs(st);
        while (rs.fetchNext())
        {
            std::cout << rs.getString(1) << std::endl;
        }

        Lob lob(con, Lob::LobTypeClob);
        std::cout << "char written " << lob.write("test") << std::endl;
        lob.seek(Lob::LobSeekSet, 0);
        std::cout << lob.read(4) << std::endl;
    }
    catch(Exception &ex)
    {
         std::cout << ex.what() << std::endl;
    }

    Environment::Cleanup();
}
/