Database Reference
In-Depth Information
Data
Server
Computer
Figure 11-4
ODBC Driver types
Web Server
Driver
Manager
Single-Tier
Driver
Application
DB
File
Input/
Output
Commands
Database Files
(a) ODBC Single-Tier Driver
Database
Server
Computer
Web Server
Driver
Manager
DBMS
Driver
Application
DBMS
DB
SQL
Commands
(b) ODBC Multiple-Tier Driver
perform considerable processing to fill in for a lack of capability at the data source. In other
cases, when the data source supports full SQL, the driver need only pass the request through
for processing by the data source. The driver also converts data source error codes and mes-
sages into the ODBC standard codes and messages.
ODBC identifies two types of drivers: single tier and multiple tier. An ODBC single-tier
driver processes both ODBC calls and SQL statements. An example of a single-tier driver is
shown in Figure 11-4(a). In this example, the data are stored in Xbase files (the format used by
FoxPro, dBase, and others). Because Xbase file managers do not process SQL, it is the job of the
driver to translate the SQL request into Xbase file-manipulation commands and to transform
the results back into SQL form.
An ODBC multiple-tier driver processes ODBC calls, but passes the SQL requests directly
to the database server. Although it may reformat an SQL request to conform to the dialect of
a particular data source, it does not process the SQL. An example of the use of a multiple-tier
driver is shown in Figure 11-4(b).
Conformance Levels
The creators of the ODBC standard faced a dilemma. If they chose to describe a standard for
a minimal level of capability, many vendors would be able to comply. But if they did so, the
standard would represent only a small portion of the complete power and expressiveness of
ODBC and SQL. However, if the standard addressed a very high level of capability, only a few
vendors would be able to comply with the standard, and it would become unimportant. To
deal with this dilemma, the committee wisely chose to define levels of conformance to the
standard. The committee defined two types of conformance: ODBC conformance and SQL
conformance.
ODBC Conformance Level
ODBC conformance levels are concerned with the features and functions that are made avail-
able through the driver's API. As previously discussed, a driver API is a set of functions that
the application can call to receive services. Figure 11-5 summarizes the three levels of ODBC
conformance that are addressed in the standard. In practice, almost all drivers provide at least
Level 1 API conformance, so the core API level is not too important.
An application can call a driver to determine which level of ODBC conformance it
provides. If the application requires a level of conformance that is not present, it can termi-
nate the session in an orderly fashion and generate appropriate messages to the user. Or the
 
Search WWH ::




Custom Search