JDBC Introduction

  • The interface for accessing relational databases from Java is JDBC. Via JDBC you maintain the databases connection, issue database queries and updates and receive the results.

  • JDBC is Java application programming interface that allows the Java programmers to access database management system from Java code It was developed byJavaSoft, a subsidiary ofSun Microsystems.

  • It is a java API which enables the java programs to execute SQL statements.

  • In short JDBC helps the programmers to write java applications that manage these three programming activities :
    1. It helps us to connect to a data source, like a database.
    2. It helps us in sending queries and updating statements to the database.
    3. Retrieving andprocessing the results received from the database in terms of answering to your query.

JDBC Driver Types:

The JDBC API uses a Driver Manager and database-specific drivers to provide transparent connectivity to heterogeneous databases.

Layers of the JDBC Architecture
JDBC Layers

Four types of JDBC Drivers :
  • Type -1 JDBC-ODBC Bridge driver.
  • Type -2 Native-API Partly-Java driver.
  • Type -3 JDBC-Net Pure-Java driver.
  • Type -4 Native Protocol Pure-Java driver.