Connecting your application to PostgreSQL
You want to create a RESTful API to server Football data to your end users. To manage this data, we decided to use a relatational database, as we are interested in prodiving data consistency and advanced query capabilities.
In this recipe, we will connect an application, a RESTful API, to a PostgreSQL database. To do that, the first thing we’ll do is deploy a PostgreSQL database in Docker.
In this recipe you will learn how to create a basic application that connects to a PostgreSQL database and perform basic SQL queries with JdbcTemplate.
Getting ready
For this recipe, you will need a PostgreSQL database. If you have already one server available, you can use it. Otherwise, you can use Docker to deploy a PostgreSQL in your computer. For that, you can execute the following command in your terminal to download and execute a PostgreSQL instance:
docker run -itd -e POSTGRES_USER=packt -e POSTGRES_PASSWORD=packt -p 5432:5432...