liveBook · Manning

JDBC driver

As explained in Spring Start Here, Second Edition

A JDBC driver is a database-specific software component that implements JDBC interfaces to enable Java applications to communicate with a relational database.

JDBC gives Java applications abstractions for working with relational databases, but the JDK does not supply an implementation for each database technology. A JDBC driver is a runtime dependency that provides the implementation for a particular database, such as MySQL, PostgreSQL, or Oracle. It enables the application to obtain database connections; it is supplied by the database vendor, not by the JDK or Spring. section 12.1

Figure 12.3 When connecting to a database, a Java app uses JDBC. The JDK provides a set of abstractions, but the app needs a certain implementation that depends on the relational database technology the app connects to. A runtime dependency named JDBC driver offers these implementations. For each specific technology, such a driver exists, and the app needs the exact driver that offers the implementations for the server technology it needs to connect to.

Follow the connection path: the application uses JDBC abstractions, and the matching runtime driver implements them for the database technology it needs to reach. section 12.1

Switching to MySQL

To connect a Spring Boot application to MySQL, add the MySQL JDBC driver as a runtime dependency and configure the database URL and credentials in application.properties. The driver supplies the database-specific implementation; Spring Boot uses the datasource properties to create a DataSource. section 12.3.1 section 12.5

How Spring Start Here, Second Edition covers it

How deep it goes
Defines the driver as a runtime implementation of JDK JDBC abstractions without detailing its internals.
Examples
Shows a MySQL runtime dependency alongside datasource URL and credential properties; PostgreSQL and Oracle are named alternatives.
What it assumes
Assumes Java applications and relational databases, while distinguishing JDBC abstractions from database-specific implementations.
What you can do after
Configure database access by adding the matching runtime driver and setting Spring datasource connection properties.
How it connects
Connects JDBC and the JDK to database technologies, and supplies connections used by a DataSource.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Start Here, Second Edition. The section links point to the parts of the book it draws on.