4

Setting Up the Database and Spring Data JPA

In the previous chapter, you learned about Spring Boot’s fundamentals to develop our backend application, such as dependency injection, beans, and annotations. In addition, we now know how to create a Spring Boot project using Spring Initializr.

This chapter will teach you how to connect your Spring Boot application to a database by adding a PSQL container and PostgreSQL dependencies and accessing data using the Java Persistence API (JPA).

In this chapter, we will cover the following topics:

  • Connecting to database using a PSQL container
  • Spring Data JPA
  • Adding Spring Data JPA and PostgreSQL dependencies
  • Connecting to a database

Technical requirements

Here is what you need to complete this chapter: ...

Get Spring Boot and Angular now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.