What is ODBC? How Does ODBC Work?

Open Database Connectivity (ODBC) provides a standard interface that allows application access to many different database implementations without writing special code for each one.

The ODBC specification was developed by Microsoft and is based on the X/Open and SQL Access Group (SAG) SQL CASE specification (1992). Basically, an ODBC application is developed without knowing anything about the specific database to be used at run-time. Before running the application, a Data Source is defined in a utility called the ODBC administrator. A data source is a defined group of information that identifies the database type and database-specific information needed to connect to the database. Note that this is done independently of the ODBC application.

The ODBC application only knows to connect to the specified data source. It doesn’t know any specifics about the database such as network transport type, database location, etc. For an ODBC compliant application to connect to a database, there must be an ODBC driver available for that specific database implementation. To connect to an Oracle Rdb database, you need to install the Oracle ODBC driver for Rdb.

There has been a proprietory client API (application programming interface) for the Oracle Rdb database for quite some time. This API is actually part of a product called Oracle SQL/Services. The Oracle ODBC driver for Rdb translates the native ODBC API calls into native SQL/Services API calls and processes the ODBC calls through the SQL/Services client/server implementation.

How Does ODBC Work?

The ODBC protocol is based on the Open DataBase Connectivity specification written by Microsoft. This specification includes a standard set of database calls used to manipulate data for a variety of databases such as Oracle Rdb and Oracle RDBMS. When an ODBC application issues an ODBC call, it is intercepted by something called the ODBC driver manager. The driver manager is a Microsoft product that can be distributed by any of the ODBC driver manufacturers. This library is called ODBC32.DLL and is located in the Windows\system32 directory on a 32-bit machine and when running 64-bit ODBC on a 64-bit machine, or the Windows\SysWOW64 directory if you are running 32 bit ODBC on a 64 bit machine.

The ODBC driver manager accepts the ODBC call and depending on the call, may take action or may forward the command to the ODBC driver specified in the ODBC connect string or Data Source.

Once the specific ODBC driver accepts the call, it translates it into language its native database can understand and forwards the statement to the backend database for processing.