Understanding ODBC Architecture
The ODBC architecture consists of four components, as described in the following list.
- Application programming interface (API) Calls ODBC functions to connect to a data source, send and receive data, and disconnect.
- Driver manager Provides information to an application (such as a list of available data sources), loads drivers dynamically as they are needed, and provides argument and state transition checking.
- Driver Processes ODBC function calls and manages all exchanges between an application and a specific relational database. If necessary, the driver may translate the standard SQL syntax into the native SQL of the target data source.
- Data source Comprises the data and its associated database engine.
Your application uses the ODBC API to connect to a data source, submit SQL statements, fetch data, and disconnect. A driver manager sits between the application and the ODBC drivers, decides which driver to load, and manages communications as driver functions are called. Finally, the drivers implement the functions of the ODBC API for the particular database. The following drawing shows how these functions interact.
What the ODBC architecture means to your application is that you can access different ODBC data sources, in different locations, using the same function calls available in the ODBC API. Once you have working code to access one relational data source, the code is easily extended to access other data sources.