Database Reference
In-Depth Information
DBMS interfaces (which are APIs) if they want to (sometimes they do this to improve perfor-
mance), but the developer who does not have the time or desire to learn many different DBMS
native libraries can use the ODBC instead.
The ODBC standard is an interface by which application programs can access and process
databases and tabular data in a DBMS-independent manner. This means, for example, that an ap-
plication that uses the ODBC interface could process an Oracle Database database, an SQL Server
database, a spreadsheet, or any other ODBC-compliant database without making any coding
changes. The goal is to allow a developer to create a single application that can access databases
supported by different DBMS products without needing to be changed or even recompiled.
ODBC was developed by a committee of industry experts from the X/Open and SQL
Access Group committees. Several such standards were proposed, but ODBC emerged as the
winner, primarily because it had been implemented by Microsoft and is an important part of
Windows. Microsoft's initial interest in support of such a standard was to allow products such
as Microsoft Excel to access database data from a variety of DBMS products without having to
be recompiled. Of course, Microsoft's interests have changed since the introduction of OLE DB
and ADO.NET.
ODBC Architecture
Figure 11-3 shows the components of the ODBC standard. The application program, driver
manager, and DBMS drivers all reside on the application server computer. The drivers send
requests to data sources, which reside on the database server. According to the standard, an
ODBC data source is the database and its associated DBMS, operating system, and network
platform. An ODBC data source can be a relational database; it can also be a file server, such as
BTrieve, or even a spreadsheet.
The application issues requests to create a connection with a data source; to issue
SQL statements and receive results; to process errors; and to start, commit, and roll back
transactions. ODBC provides a standard means for each of these requests, and it defines a
standard set of error codes and messages.
The ODBC driver manager serves as an intermediary between the application and the
DBMS drivers. When the application requests a connection, the driver manager determines
the type of DBMS that processes a given ODBC data source and loads that driver into memory
(if it is not already loaded). The driver manager also processes certain initialization requests
and validates the format and order of ODBC requests that it receives from the application. For
Windows, the driver manager is provided by Microsoft.
An ODBC driver processes ODBC requests and submits specific SQL statements to a
given type of data source. Each data source type has a different driver. For example, there are
drivers for SQL Server, for Oracle Database, for MySQL, for Microsoft Access, and for all of the
other products whose vendors have chosen to participate in the ODBC standard. Drivers are
supplied by DBMS vendors and by independent software companies.
It is the responsibility of the driver to ensure that standard ODBC commands execute
correctly. In some cases, if the data source is itself not SQL compliant, the driver may need to
Application Server
Data Sources
Figure 11-3
ODBC architecture
DBMS 1
DBMS Driver 1
DB
Driver
Manager
Application
DBMS Driver 2
DBMS 2
DB
DBMS Driver 3
DBMS 3
DB
Application can process a database using any of the three
DBMS products.
 
 
Search WWH ::




Custom Search