From the course: Learning Spring 6 with Spring Boot 3

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Use a remote database

Use a remote database

- [Instructor] Now that we have things running with an embedded database, it's time to leverage our PostgreSQL image to show you what it would be like to use a remote database, which is much more real-world for what you're going to do. Now, the key thing here is that even though Postgres is running locally, the connection string is just pointing to local host as opposed to a remote host. So it's really the same thing as configuring to any remote database. I want you to jump into your IDE, and the first place that we're going to go is our pom.xml file. Now, we are going to remove the h2database. And instead, we are going to replace it with postgresql. Again, we will let Spring Boot handle the version, and we're going to run a Maven import. Now I want you to go to src/main/resources, and open up your application.properties file. Now, we are going to leave the ddl-auto equal to none, but on top of that, we are going to…

Contents