0Pricing
Java Academy · Lesson

JDBC Fundamentals

Connections, statements, result sets.

What is JDBC?

JDBC (Java Database Connectivity) is the standard API for talking to relational databases from Java.

  • It lives in the java.sql package.
  • Each database ships a driver that implements the JDBC interfaces.
  • You write code against interfaces like Connection, Statement, and ResultSet — never against the vendor classes directly.

This abstraction lets the same code work against PostgreSQL, MySQL, H2, or Oracle.

The Core Interfaces

Three interfaces do most of the work:

  • Connection — an open session with the database.
  • Statement / PreparedStatement — sends SQL.
  • ResultSet — a cursor over the rows returned by a query.

You obtain a Connection from DriverManager or a DataSource.

All lessons in this course

  1. JDBC Fundamentals
  2. PreparedStatement
  3. Transactions
  4. Connection Pooling with HikariCP
← Back to Java Academy