ODBC Architecture
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
Figure 11-2
Relational Databases: Oracle Database,
Role of the ODBC Standard
Native
DBMS
Microsoft SQL Server,
Interfaces
Oracle MySQL, Microsoft Access, IBM DB2 . . .
Browser
ODBC
Nonrelational Databases
VSAM, ISAM, Other
Browser
Web Server
File Processors
Browser
E-mail, Other Document Types
Pictures, Audio, Other????
Part 5 Database Access Standards
Application Server
Data Sources
DBMS Driver 1 DBMS 1 DB
Driver Application Manager DBMS Driver 2 DBMS 2
DB
DBMS Driver 3 DBMS 3
DB
Figure 11-3
Application can process a database using any of the three ODBC Architecture
DBMS products.
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 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 messages 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).
Parts
» This page intentionally left blank
» Reporting and Data Mining Database Applications
» Database Applications and SQL
» Reading Specified Columns and Rows from a Single Table
» “Does Not Work with Microsoft Access ANSI-89 SQL”
» Processing SQL Statements in Microsoft Access 2010
» Using SQL in Microsoft SQL Server 2008 R2
» Using SQL in Oracle Database 11g
» Using SQL in Oracle MySQL 5.5
» Wildcards in SQL WHERE Clauses
» Using SQL Built-in Functions
» SQL Expressions in SQL SELECT Statements
» Querying Multiple Tables with Subqueries
» Querying Multiple Tables with Joins
» Comparing Subqueries and Joins
» Finding Functional Dependencies
» Eliminating Anomalies from Multivalued Dependencies
» The Multivalue, Multicolumn Problem
» The General-Purpose Remarks Column
» R Diagrams Using the IE Crow’s Foot Model
» The Multivalued Attribute Pattern
» The Archetype/Instance Pattern
» The Student Acceptance Letter
» X This is a warning, no further action is required.
» 1:1 Relationships Between Strong Entities
» M Relationships Between Strong Entities
» Relationships in Mixed Entity Designs
» Representing Ternary and Higher-Order Relationships
» Relational Representation of the Highline University Data Model
» Surrogate Key Database Design
» Column Properties for the View Ridge Database Design Tables
» Variations in SQL Data Types
» Implementing Data Constraints
» Populating the View Ridge Database Tables
» Using Triggers to Provide Default Values
» The WORK_AddWorkTransaction Stored Procedure
» • If a PROJECT row is deleted, then the project has been canceled, and it is unneces-
» Reducing Cardinalities (with Data Loss)
» Optimistic Versus Pessimistic Locking
» Declaring Lock Characteristics
» Processing Rights and Responsibilities
» Recovery via Rollback/Rollforward
» Maintaining the Data Repository
» Types of Distributed Databases
» • Express Edition. This free, feature-limited version is available for download. It
» SQL Server 2008 R2 SQL Statements and SQL Scripts
» Creating the View Ridge Database Table Structure
» Populating the VRG Tables with Data
» The Stored Procedure InsertCustomerAndInterests
» The Stored Procedure InsertCustomerWithTransaction
» A Trigger for Setting Default Values
» A Trigger for Enforcing a Data Constraint
» A Trigger for Enforcing a Required Child Constraint
» Creating an ODBC Data Source Name
» Materializing XML Documents with XSLT
» Using the SQL SELECT . . . FOR XML Statement
» Multitable SELECT with FOR XML
» A Schema with Two Multivalued Paths
» Problems with Operational Data
» Using SQL for Market Basket Analysis
Show more