Developer(s) | Vincent Rogier |
---|---|
Stable release | 3.9.3 / December 5, 2011 |
Written in | C |
Operating system | Cross-platform |
Type | API |
License | GNU LGPL |
Website | http://www.ocilib.net/ |
OCILIB is an open source and cross platform Oracle C library that delivers fast and reliable access to Oracle databases.
The OCILIB library :
OCILIB is used in applications written in various languages such as C, C++, Objective-C, Erlang, Lisp, PureBasic, Blitz BASIC, and others.
Contents |
OCILIB runs on any 32 bits and 64 bits platform having an ISO C compliant compiler and supported by Oracle.
Here is the lists of validated configurations.
OCILIB supports all Oracle SQL and PL/SQL datatypes :
Example of a complete minimal OCILIB 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; }