JAVA DATABASE CONNECTIVITY JDBC Vs. ODBC
used interface to access relational databases today is Micorsoft’s ODBC API. ODBC
stands for Open Database Connectivity, a standard database access method developed
by the SQL Access group in 1992. Through ODBC it is possible to access any data
from any application, regardless of which database management system (DBMS) is
handling the data. ODBC manages this by inserting a middle layer, called a database
driver, between an application and the DBMS. The purpose of this layer is to translate
the application's data queries into commands that the DBMS understands.
Microsoft ODBC API offers connectivity to almost all databases on almost all
platforms and is the most widely used programming interface for accessing relational
databases. But ODBC cannot be used directly with Java Programs due to various
reasons described below.
1) ODBC cannot be used directly with Java because, it uses a C interface. This will
have drawbacks in the security, implementation, and robustness.
2) ODBC makes use of Pointers, which have been removed from Java.
3) ODBC mixes simple and advanced features together and has complex structure.
Hence, JDBC came into existence. If you had done Database Programming with
Visual Basic, then you will be familiar with ODBC. You can connect a VB
Application to MS-Access Database or an Oracle Table directly via ODBC. Since
Java is a product of Sun Microsystems, you have to make use of JDBC with ODBC in
order to develop Java Database Applications.
JDBC is an API (Application Programming Interface) which consists of a set of Java
classes, interfaces and exceptions With the help of JDBC programming interface, Java
programmers can request a connection with a database, then send query statements
using SQL and receive the results for processing.
According to Sun, specialised JDBC drivers are available for all major databases —
including relational databases from Oracle Corp., IBM, Microsoft Corp., Informix
Corp. and Sybase Inc. — as well as for any data source that uses Microsoft's Open
Database Connectivity system.
The combination of Java with JDBC is very useful because it lets the programmer run
his/ her program on different platforms. Some of the advantages of using Java with
JDBC are:
• Easy and economical
• Continued usage of already installed databases
• Development time is short
• Installation and version control simplified
No comments:
Post a Comment