# Querying a Database

Querying a Database: Querying a Database: an overview, JDBC Objects, Full Example.

Updated: November 16, 2026

1. [Querying a Database: an overview](https://www.ask-codey.com/lessons/querying-a-database-an-overview) (Journeyman): Reading data from a database in Java takes three steps: connect to the database, run an SQL query, and read the results.
2. [JDBC Objects](https://www.ask-codey.com/lessons/querying-a-database-jdbc-objects) (Journeyman): Meet the three objects that query MySQL from Java: a BasicDataSource to connect, a JdbcTemplate to run SQL, and a SqlRowSet to read the rows that come back.
3. [Full Example](https://www.ask-codey.com/lessons/querying-a-database-full-example) (Journeyman): A complete main method that connects to the northwind database, selects every product, and prints each product's id, name and price.

Source: https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/querying-a-database
