From the course: Spring Data

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Connect to remote database

Connect to remote database - Spring Tutorial

From the course: Spring Data

Connect to remote database

- [Instructor] Let's actually run this application connected to a real external database. In our example, we are going to pivot to using Postgres instead of H2, so database changes will be truly persisted. Since our data store will be running outside the context of our application, we need to set up connectivity. There are two required items, add the database driver dependency to our application and provide the correct connection parameters. To create our database instance, we are going to leverage Docker and the schema.xml file we already created. The codespace instance already has Docker running. If you want to follow along on your machine, you will have to install and run Docker locally. If you don't already know about Docker, we're going to follow a cookbook-type of approach, so don't worry. However, if you'd like to learn more about it, check out my course, Intro to Docker for Java Developers. We're going to look at this file, docker-compose, that's in the exercise files. I'm on…

Contents