JDBC Structure – TECHARGE

Shubham
3 Min Read

On this article, you’ll study JDBC Structure akin to Two-tier Structure, Three-tier Structure and JDBC API.

JDBC (Java Database Connectivity) structure defines how a Java software interacts with a database. There are two primary architectural fashions utilized in JDBC:

  1. Two-tier Structure
  2. Three-tier Structure

Two-tier Structure

In a two-tier structure, the Java software instantly communicates with the database supply. The JDBC driver acts as a bridge between the applying and the database, translating the Java program’s requests into the database’s particular question language (often SQL) and vice versa.

Benefits:

You May Be In

  • Easy to implement
  • Environment friendly for small-scale purposes

Disadvantages:

  • Tight coupling between the applying and the database
  • Safety issues because the database entry logic resides throughout the software
  • Restricted scalability

Three-tier Structure

In a three-tier structure, a center tier is launched between the Java software and the database. The applying tier handles the consumer interface and enterprise logic, whereas the center tier (enterprise logic tier) manages the communication with the database. The database tier stays answerable for storing and managing information.

Benefits:

  • Improved safety: Database entry logic is remoted within the center tier
  • Elevated scalability: The applying and database tiers might be scaled independently
  • Simpler upkeep: Adjustments to the enterprise logic might be made within the center tier with out affecting the applying or database tiers

Disadvantages:

  • Extra complicated to implement than a two-tier structure
  • Introduces further overhead as a result of additional layer of communication

The selection between a two-tier and three-tier structure depends upon the particular wants of the applying. A two-tier structure is appropriate for easy purposes the place safety and scalability usually are not main issues. A 3-tier structure is preferable for complicated purposes that require higher safety and scalability.

JDBC API

The JDBC API helps each two-tier and three-tier processing fashions for database entry however typically, JDBC Structure consists of two layers.

  • JDBC API: This gives the application-to-JDBC Supervisor connection.
  • JDBC Driver API: This helps the JDBC Supervisor-to-Driver Connection.

The JDBC API makes use of a driver supervisor and database-specific drivers to supply clear connectivity to heterogeneous databases.

The JDBC driver supervisor ensures that the proper driver is used to entry every information supply. The motive force supervisor is able to supporting a number of concurrent drivers linked to a number of heterogeneous databases.

Following is the architectural diagram, which reveals the placement of the driving force supervisor with respect to the JDBC drivers and the Java software

JDBC Architecture
JDBC Structure
Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *