Skip to content
Ameen Abozaid
Planned lessonJNR-026-L05

Demo: replacing the in-memory repository with Spring JDBC

  • Lesson 5 of 5
  • Junior
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

swap the Shop repository implementation without touching controllers or services; prepares JNR-026-LAB1.

Draft outline details

Step by step

  1. Show the existing ProductRepository interface and the in-memory implementation.
  2. Apply schema.sql manually in local PostgreSQL and add the datasource properties.
  3. Create JdbcProductRepository implements ProductRepository using JdbcClient and a shared mapper.
  4. Planned mistake: forget the @Repository/bean switch so two implementations exist; show the startup error and remove the in-memory bean.
  5. Run the existing API tests; they pass unchanged.
  6. Add one integration test against a real PostgreSQL database.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.