Open Database Connectivity
From Free net encyclopedia
Open Database Connectivity (ODBC) provides a standard software API method for using database management systems (DBMS). The designers of ODBC aimed to make it independent of programming language, database system and operating system.
Contents |
Description
The ODBC specification offers a procedural API for using SQL queries to access data. An implementation of ODBC will contain one or more applications, a core ODBC library, and one or more "database drivers". The core library, independent of the applications and DBMS systems, acts as an "interpreter" between the applications and the database drivers, whereas the database drivers contain the DBMS-specific details. Thus a programmer can write applications that use standard types and features without concern for the specifics of each DBMS that the applications may encounter. Likewise, database driver implementors need only know how to attach to the core library. This makes ODBC modular.
To write ODBC code that exploits DBMS-specific features requires more advanced programming. An application must use introspection, calling ODBC metadata functions that return information about supported features, available types, syntax, limits, isolation levels, driver capabilities and more.
ODBC provides the standard of ubiquitous data access because hundreds of ODBC drivers exist for a large variety of data sources. ODBC is available for a variety of operating systems and there are drivers for non-relational data such as spreadsheets, text and XML files. Because ODBC dates back more than ten years, it offers connectivity to a wider variety of data sources than other data access APIs. There are more drivers for ODBC than drivers or providers for newer APIs such as OLE DB, JDBC and ADO.NET.
Despite the benefits of ubiquitous connectivity and platform independence, ODBC has certain drawbacks. Administering a large number of client machines can involve a diversity of drivers and DLLs. This complexity can increase system administration overhead. Large organizations with thousands of PCs have often turned to ODBC server technology to simplify the administration problem.
The layered architecture of ODBC can introduce a minor performance penalty. The overhead of executing an additional layer of code generally appears insignificant compared to network latency and other factors that influence query performance. Driver architecture is also a consideration. Many first-generation ODBC drivers operated with database client libraries supplied by a DBMS vendor. An ODBC driver for Oracle, for example, would use Oracle's network library (SQL*Net, Oracle Net) and OCI client library. Similarly, a driver for Sybase or Microsoft SQL Server would use a vendor-supplied network library to emit Tabular Data Stream (TDS) packets. Those earlier drivers have been largely supplanted by wire protocol drivers that do not use database client libraries. The newer type of driver communicates using protocols such as TDS, TNS, and DRDA without needing database client libraries.
Differences between drivers and driver maturity can also raise important issues. Newer ODBC drivers are often less stable than drivers that have been in production for years. Years of testing and deployment mean a driver is less likely to contain bugs.
To use DBMS-specific features with ODBC, a developer must understand adaptive programming techniques such as introspection and writing interoperable SQL statements. Even when programmers use adaptive techniques, however, ODBC may not provide some advanced DBMS features. The ODBC 3.x API is well-suited to traditional SQL applications such as OLTP but it has not evolved to support richer types introduced by SQL:1999 and SQL:2003.
Developers needing features or types not accessible with ODBC can use other SQL APIs. When not aiming for platform-independence, developers can use proprietary APIs. If creating portable, platform-independent code is a goal, developers can use the JDBC API.
History
ODBC uses as its bases the Call Level Interface (CLI) specifications from the SQL Access Group, X/Open (now part of The Open Group), and the ISO/IEC. Microsoft founded ODBC by adapting the SQL Access Group CLI. It released ODBC 1.0 in September, 1992. After ODBC 2.0, Microsoft decided to align ODBC 3.0 with the CLI specification making its way through X/Open and ISO. In 1995, SQL/CLI became part of the international SQL standard.
Implementations
ODBC implementations exist for many operating systems, including Microsoft Windows, Unix, Linux, OS/2, and Mac OS X. Hundreds of ODBC drivers exist, including drivers for Oracle, DB2, Microsoft SQL Server, Sybase, Pervasive SQL, MySQL, PostgreSQL and desktop database products such as Filemaker and Microsoft Access.
Microsoft ODBC
Microsoft released the first ODBC product: as a set of DLLs for Microsoft Windows.
ODBC-JDBC bridges
A JDBC-ODBC bridge consists of a JDBC driver which employs the ODBC driver to connect to the database. This driver translates JDBC method calls into ODBC function calls. Programmers usually use such a bridge when a particular database lacks a JDBC driver . Sun included one such bridge in the JVM, but viewed it as a stop-gap measure while few JDBC Drivers existed. Sun never intended its bridge for production environments, and generally recommends against its use. Independent data access vendors now deliver JDBC-ODBC bridges which support current standards for both mechanisms, and which far outperform the JVM built-in.
iODBC
Template:Main iODBC (http://www.iodbc.org/), or Independent Open DataBase Connectivity, offers an open source, platform-independent implementation of both the ODBC and X/Open specifications, generally used on platforms other than Microsoft Windows. The iODBC project is distributed under the LGPL and/or BSD License, and is maintained and supported by OpenLink Software. Apple chose to bundle iODBC into Mac OS X and Darwin, starting with Darwin 6.0 and Mac OS X v10.2. iODBC has been ported to several other operating systems and hardware platforms, including Mac OS 9, Linux (x86, Itanium, Alpha, MIPS, and ARM), Solaris (SPARC & x86), AIX, HP-UX (PA-RISC & Itanium), Compaq Tru64, Digital UNIX, Dynix, Generic UNIX 5.4, FreeBSD, DG-UX, and OpenVMS.
UnixODBC
The UnixODBC project — headed, maintained and supported by Easysoft Director Nick Gorham — has become the most common driver manager for non-Microsoft Windows platforms (and for one Microsoft platform, Interix). It offered full ODBC3 support and Unicode in advance of its competitors. Most Linux distributions now include it, including (for example) Red Hat, Mandriva and Gentoo. Several vendors of commercial databases, including IBM (DB2, Informix), Oracle and SAP (Ingres) use it for their own drivers. It includes GUI support for both KDE and GNOME. Many open source projects — including OpenOffice.org and Glade — also make use of it. It builds on any platform that supports the GNU autoconf tools (in other words, most of them). For licensing, UnixODBC uses the LGPL and GPL.
UDBC
UDBC, a cross-platform fusion of ODBC and SAG CLI, enabled non-Windows-based DBMS-independent application development at a time when shared-library implementations on Unix occurred only sporadically. This effort laid the foundation for the iODBC Open Source project.
External links
- Microsoft ODBC Documentation
- Presentation slides from www.roth.net
- The iODBC.org home page
- Data Access Workshop: ODBC slides at SQLSummit.com
- ODBC Portal
- Understanding ODBC and multidatabase adaptive programming
- Understanding ODBC 3.0 and OLE DB
- iODBC.org paper about ODBC on the Mac
- How to write ODBC drivers for MacOS X
- OpenLink Software data access home page
- The unixODBC Project home page
- The ODBC Hall of Fame
- Early ODBC White Paper
- Unix ODBC Story
- ODBC & PHP Installation & Config Guide
- Mac OS Platforms ODBC Guide
- Macintouch's ODBC for Mac OS Platform Chronicles
- State of ODBC and SQL on Mac OS circa 1999
- What is ODBC?
Sources of ODBC driver managers
Sources of ODBC drivers
- Comprehensive catalog of ODBC Drivers at SQLSummit.com
- OpenAccess SDK for Implementing Custom ODBC Driversde:ODBC
es:ODBC fi:ODBC fr:Open database connectivity it:ODBC ja:Open Database Connectivity lt:ODBC nl:Open DataBase Connectivity pl:ODBC ru:ODBC