Here you will learn about difference between odbc and jdbc in detail.
ODBC and JDBC might look similar but they actually hold a good measurable field of differences among them. Although, both are used for database connectivity, their usage and features are quite apart from each other. Here is a brief introduction of the two.
ODBC stands for the Open Database Connectivity. As it is very clear from the term itself, the ODBC lets you connect your program to the database system.
JDBC stands for the Java Database Connectivity. It lets you connect your java program to the Database.
Difference between ODBC and JDBC – ODBC vs JDBC
|Introduction||Open Database Connectivity. An Application Programming Interface (API) for accessing Database.||Java Database Connectivity. An Application programming interface for connecting programs written only in the java language with the database.|
|Release||Released by SQL Access Group (Microsoft) in September 1992.||Released by Sun Microsystems in February 1997 (As a part of the java development kit).|
|Pointers||ODBC makes use of pointers as it contains a ‘C’ interface.||Doesn’t have any use of the pointers as it uses Java interface.|
|Complexity||More complex solutions to simple queries.||Simple and less complex uses advanced capabilities as and when required.|
|Relation||Basis of ODBC, it is the basic idea behind JDBC. Hence, does not retain any of the JDBC features.||An advancement of the ODBC. Retains some of the features of the ODBC.|
|Installation||Requires manual installation of the ODBC drivers in all the machines. The core components including driver manager, cursor library, installer DLL. Drivers and translators all need to be installed in order to work with the ODBC.||Does not need any manual installation. It is installed automatically, as soon as the java development kit is installed. All you need to have is the compatible databases you need to work with.|
|Dependency||Language independent. It is an open interface which can connect any language to the database.||Unlike ODBC, JDBC can connect only the programs written in java language to the database.|
|Architecture||Consists of 4 components:
API>Driver manager>Driver> Data source.
The API connects the ODBC functions to a data source and then disconnects immediately after sending and receiving data. The Driver manager loads driver dynamically i.e., as and when required. Also, it then reports to the application. The driver finally manages all the function calls and lets the processing of the function calls. The data source is the component which interacts directly with the driver; it processes requests from the driver and thereafter, returns results to the driver.
|The JDBC architecture consists of two major components: JDBC API- a set of classes, interfaces and exceptions used for connecting with the data source and JDBC driver types. The JDBC architecture as defined by the sun Microsystems can be of both three and two tier.
Two tier architecture: In two tier architecture, link is established directly between the java application and the data source.
Three tier architecture: In the three tier architecture, there is an additional server machine which implies business logic. This is actually the application server which acts as a link between the java applet and the DBMS is needs access to.
The main difference between ODBC and JDBC have been compared above. Both are basically the connectivity interface which lets us solve the problem of connecting our application programs to relational database systems.
Comment below if you have queries related to above tutorial for jdbc vs odbc.