Data Access Library for Eiffel contents structure

ODBC architecture

The ODBC architecture has four components:

  1. Application: performs processing and calls ODBC functions to submit SQL statements and retrieve results.
  2. Driver Manager: loads drivers on behalf of an application.
  3. Driver: processes ODBC function calls, submits SQL requests to a specific data source, and returns results to the application. If necessary, the driver modifies an application's request so that the request conforms to syntax supported by the associated DBMS.
  4. Data source: consists of the data the user wants to access and its associated operating system, DBMS, and network platform (if any) used to access the DBMS.

The following diagram shows the relationship between the four components:

The relationship between ODBC components

An application using the ODBC interface performs the following tasks:

An application can provide a variety of features external to the ODBC interface, including mail, spreadsheet capabilities, online transaction processing, and report generation; the application may or may not interact with users.

The Driver Manager, provided by Microsoft, is a dynamic-link library (DLL) with an import library. The primary purpose of the Driver Manager is to load drivers. The Driver Manager also performs the following:

Driver is a DLL that implements ODBC function calls and interacts with a data source. A driver performs the following tasks in response to ODBC function calls from an application:

  1. Establishes a connection to a data source.
  2. Submits requests to the data source.
  3. Translates data to or from other formats, if requested by the application.
  4. Returns results to the application.
  5. Formats errors into standard error codes and returns them to the application.
  6. Declares and manipulates cursors if necessary. (This operation is invisible to the application unless there is a request for access to a cursor name.)
  7. Initiates transactions if the data source requires explicit transaction initiation. (This operation is invisible to the application.)

Data source is a specific instance of a combination of a DBMS product and any remote operating system and network necessary to access it.

An application establishes a connection with a particular vendor's DBMS product on a particular operating system, accessible by a particular network. For example, the application might establish connections to:

One of the strengths of the ODBC interface is interoperability; a programmer can create an ODBC application without targeting a specific data source. Users can add drivers to the application after it is compiled and shipped.

From an application standpoint, it would be ideal if every driver and data source supported the same set of ODBC function calls and SQL statements. However, data sources and their associated drivers provide a varying range of functionality. Therefore, the ODBC interface defines conformance levels, which determine the ODBC procedures and SQL statements supported by a driver.

ODBC defines conformance levels for drivers in two areas: the ODBC API and the ODBC SQL grammar (which includes the ODBC SQL data types). Conformance levels help both application and driver developers by establishing standard sets of functionality. Applications can easily determine if a driver provides the functionality they need. Drivers can be developed to support a broad selection of applications without being concerned about the specific requirements of each application.

To claim that it conforms to a given API or SQL conformance level, a driver must support all the functionality in that conformance level, regardless of whether that functionality is supported by the DBMS associated with the driver. However, conformance levels do not restrict drivers to the functionality in the levels to which they conform. Driver developers are encouraged to support as much functionality as they can; applications can determine the functionality supported by a driver by special functions.


Copyright © Object Tools -- info@object-tools.com
Last updated: 2005/02/02 11:51:24