ODBC
Database client technologies provide abstractions. That is their purpose. A database is a very complex piece of software. Writing programs to communicate with a database through its native interface can be very complicated. Database client technologies simplify this process.
Database client technologies provide an interface that is less complex than the underlying database. Database client interfaces provide leverage for you, the developer. They enable you to write relatively simple programs that leverage an enormous amount of code (code that resides in the database) to perform very complex tasks.
A good database interface is like a magnifying glass for your code.
Writing programs to communicate with a database through its native interface not only can be complex but also can result in limited and inflexible applications. An application written to use a particular database's native interface is limited, of course, to using only that particular database. The process of enabling such an application to use another database can be very difficult and time-consuming, if not impossible.
Database client technologies provide a uniform interface for communicating with different and disparate database systems. With modern database client interfaces, you can write a single program that performs complex operations using multiple types of databases.
A good database interface magnifies your code and provides a uniform interface to different database systems. In the recent past, several database interfaces have been developed. These database interfaces differ from each other in the things they accomplish and the way they go about them.
The popular database interfaces on the Windows platforms include
· ODBC (open database connectivity)
· MFC (Microsoft Foundation Classes) ODBC classes
· DAO (Data Access Objects)
· RDO (Remote Data Objects)
· OLE DB (object-linking and embedding database - the expanded acronym makes no sense unless you know its historical context, which you will learn shortly)
· ADO (ActiveX Data Objects)
ODBC was created in the late '80s and early '90s to provide a uniform interface for writing client software for relational databases. ODBC provides a single API for client applications to work with different databases. Applications that use the ODBC API can communicate with any relational database for which there is an ODBC driver.
Compared to other database interfaces, the ODBC API could be classified as a low-level database interface. The ODBC API enables client applications to configure and control the database at a relatively low level.
ODBC was designed to provide an interface to relational databases. ODBC has become quite popular and is generally accepted as a standard for interfacing with relational database systems.
ODBC is limited to relational databases. Because of the relational nature of ODBC, it's difficult to use ODBC to communicate with nonrelational data sources, such as object databases, network directory services, email stores, and so on.
ODBC provides the ODBC Driver Manager (ODBC32.DLL), an import library (ODBC32.LIB), and ODBC header files for the ODBC API. Client applications link with the import library to use the functions exposed by the ODBC Driver Manager. At runtime, the ODBC Driver Manager calls functions in the ODBC drivers (which are also DLLs) to perform operations on the databases, as shown in Figure 10.3.
New Term: ODBC does not provide an embedded SQL interface. With embedded SQL, the SQL code is embedded in the application program source code. A precompiler transforms the SQL code at build time into native function calls that call the database's runtime library.
New Term: ODBC provides a call-level interface (CLI). A CLI is a special kind of database API. A CLI, like a typical API, provides functions for client applications to call. However, in a CLI, the SQL code in the client application is not precompiled. Rather, the API provides functions that enable the application to send the SQL code to the database at runtime. The SQL code is interpreted at runtime.
JDBC
JDBCTM technology is an API that lets you access virtually any tabular data source from the JavaTM programming language. It provides cross-DBMS connectivity to a wide range of SQL databases, and now, with the new JDBC API, it also provides access to other tabular data sources, such as spreadsheets or flat files.
The JDBC API allows developers to take advantage of the Java platform's "Write Once, Run AnywhereTM" capabilities for industrial strength, cross-platform applications that require access to enterprise data. With a JDBC technology-enabled driver, a developer can easily connect all corporate data even in a heterogeneous environment.
JDBC is a Java API for database connectivity that is part of the Java API from JavaSoft. JDBC is not an acronym though people often think it stands for "Java DataBase Connectivity". JDBC provides an API in the package java.sql that makes it possible to develop database applications using Java.
Using JDBC, a developer could execute SQL statements from any relational database. It is not necessary to develop a separate program to access databases from different vendors.
0 comments on ODBC and JDBC