What is ODBC?
Open Database Connectivity (ODBC) is a standard software API specification for using database management systems (DBMS). ODBC is independent of programming language, database system and operating system.
ODBC was created by the SQL Access Group and first released in September, 1992. ODBC is based on the Call Level Interface (CLI) specifications from SQL, X/Open (now part of The Open Group), and the ISO/IEC.
The ODBC API is a library of ODBC functions that let ODBC-enabled applications connect to any database for which an ODBC driver is available, execute SQL statements, and retrieve results.
The goal of ODBC is to make it possible to access any data from any application, regardless of which database management system (DBMS) is handling the data. ODBC achieves this by inserting a middle layer called a database driver between an application and the DBMS. This layer translates the application's data queries into commands that the DBMS understands.
Overview of OCI
The Oracle Call Interface (OCI) is an application programming interface (API) that lets you create applications that use function calls to access an Oracle database server and control all phases of SQL statement execution. OCI supports the datatypes, calling conventions, syntax, and semantics of C and C++.
OCI provides:
-
Improved performance and scalability through the efficient use of system memory and network connectivity
-
Consistent interfaces for dynamic session and transaction management in a two-tier client/server or multitier environment
-
N-tier authentication
-
Comprehensive support for application development using Oracle objects
-
Access to external databases
-
Applications that support an increasing number of users and requests without additional hardware investments
OCI lets you manipulate data and schemas in an Oracle database using C programming language. It provides a library of standard database access and retrieval functions in the form of a dynamic runtime library (OCI library) that can be linked in an application at runtime.
> 1. Does ODBC driver internally uses OCI APIs, if not how the data
> connectivity is achieved.
Well, I'm not qualified to comment on the detail. But is there an OCI layer
within the ODBC network stack? Yes, absolutely. It's why an Excel
spreadsheet connecting to a RAC, for example, can fail over to the surviving
node/instance when one instance or node fails (though it's not transparent,
because Excel doesn't know how to make a call-back to the new node). Only
OCI apps. can failover, so the fact that Excel, via ODBC, does failover
means OCI has got to be in the ODBC stack somewhere (technically, I believe,
it's an extension to the two-task common layer).
> 2. Is Data connectivity using OCI APIs is faster than ODBC API calls.
Heaps. A lot of clunking goes on inside that ODBC layer: you're converting
non-OCI calls into OCI ones. Conversion takes time.
A native OCI app (such as SQL Plus, for example) will always rocket streets
ahead of an ODBC-based app. in terms of the efficiency with which it handles
connectivity between front and backends.
Regards
HJR
--http://dbaspot.com/forums/oracle-server/9142-odbc-vs-oci.html