JDBC (Java Database Connectivity)

> Procedural Languages > Java > JDBC (Java Database Connectivity)

1 - About

JDBC – Java Database Connectivity is a Java API that provides access to most popular databases or to other tabular data sources. It provides methods for querying and updating data in a database.

JDBC becomes more and more popular in the database connectivity than ODBC.

JDBC is a flexible API that provide 4 different ways (type) to connect to a data server.

JDBC is an industry-standard application programming interface (API) developed by Sun Microsystems that lets you invoke SQL statements in Java code. JDBC is based on the X/Open SQL Call Level Interface (CLI) and complies with the Entry Level of the SQL-92 standard.

Each vendor, such as Oracle, creates its JDBC implementation by implementing the interfaces of the standard java.sql package. The core Java class libraries provide the JDBC APIs, java.sql and javax.sql.

The JDBC (api|library) is a defined through set of interfaces: java.sql package.

Advertising

3 - Architecture and getting started

Applications

  1. retrieve a connection object (where you can specify transaction, connection attributes)
  2. Then creates a statement object to execute SQL statements (DML, DDL, …) and retrieve results.

4 - Architecture

Relationships between major classes and interface in the java.sql package

5 - Library based on JDBC

6 - Documentation / Reference