June 2025
Intermediate to advanced
1129 pages
53h
English
To become familiar with the JDBC API, let’s start with an example.
The following steps are required to access a relational database with JDBC:
Including the JDBC database drivers in the module path
Possibly logging in the driver classes
Connecting to the database
Creating SQL statements
Executing SQL statements
Retrieving the result of the statement and possibly iterating over the result (in the case of result sets)
Closing the database connection
In the following sections, we’ll limit our work to establishing a connection to the free DBMS H2. Access for other relational database will be similar—except for the JDBC URL itself.
Read now
Unlock full access