Overview of Java Database Connectivity

Thanusri swetha J October 17, 2021 | 10:00 AM Technology

JDBC is an acronym for Java Database Connectivity. It’s an advancement for ODBC (Open Database Connectivity). JDBC is a standard API specification developed in order to move data from frontend to backend. This API consists of classes and interfaces written in Java. It basically acts as an interface (not the one we use in Java) or channel between your Java program and databases (i.e) it establishes a link between the two so that a programmer could send data from Java code and store it in the database for future use. [1]

Figure 1. Overview of Java Database Connectivity

Figure 1 shows developed as an alternative to the C-based ODBC (Open Database Connectivity) API, JDBC offers a programming-level interface that handles the mechanics of Java applications communicating with a database or RDBMS. The JDBC interface consists of two layers:

  • The JDBC API supports communication between the Java application and the JDBC manager.
  • The JDBC driver supports communication between the JDBC manager and the database driver.

JDBC is the common API that your application code interacts with. Beneath that is the JDBC-compliant driver for the database you are using. [2]

Applications of JDBC

Fundamentally, JDBC is a specification that provides a complete set of interfaces that allows for portable access to an underlying database. Java can be used to write different types of executables, such as −

  • Java Applications
  • Java Applets
  • Java Servlets
  • Java Server Pages (JSPs)
  • Enterprise JavaBeans (EJBs)

All of these different executables are able to use a JDBC driver to access a database, and take advantage of the stored data. JDBC provides the same capabilities as ODBC, allowing Java programs to contain database-independent code. [3]

Components of JDBC

There are generally four main components of JDBC through which it can interact with a database. They are as mentioned below:

  • JDBC API: It provides various methods and interfaces for easy communication with the database. It provides two packages as follows which contains the java SE and java EE platforms to exhibit WORA(write once run everywhere) capabilities.
    • java.sql.*;
    • javax.sql.*;
  • JDBC Driver manager: It loads database-specific driver in an application to establish a connection with a database. It is used to make a database-specific call to the database to process the user request.
  • JDBC Test suite: It is used to test the operation (such as insertion, deletion, updation) being performed by JDBC Drivers.
  • JDBC-ODBC Bridge Drivers: It connects database drivers to the database.This bridge translates JDBC method call to the ODBC function call. [4]
References:
  1. https://www.geeksforgeeks.org/establishing-jdbc-connection-in-java/
  2. https://www.infoworld.com/article/3388036/what-is-jdbc-introduction-to-java-database-connectivity.html
  3. https://www.tutorialspoint.com/jdbc/index.htm
  4. https://www.geeksforgeeks.org/introduction-to-jdbc/
Cite this article:

Thanusri swetha J (2021) Overview of Java Database Connectivity, Anatechmaz, pp. 32

Recent Post

Blog Archive