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