# Querying a Database: an overview

Reading data from a database in Java takes three steps: connect to the database, run an SQL query, and read the results.

Journeyman · Java · SQL · Updated November 16, 2026

By Gregor Dzierzon

The dependencies we added in Configure the Project give us the objects we need to connect to a database and run a query.

Working with data from a database requires three steps.

- Establishing a connection to the database
- Executing an SQL query
- Reading the results of the query

Let's take a closer look at these steps and the objects required to perform them.

## Cheat sheets

- [JDBC Objects](https://www.ask-codey.com/cheat-sheets/querying-a-database-jdbc-objects-cheat-sheet)

Source: https://www.ask-codey.com/lessons/querying-a-database-an-overview
