O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. In the src/main/resources/application.properties file, add a new springboot property, spring.profiles.active = local.
  2. Create a new file, application-local.properties, at the location, src/main/resources/
  3. Add the following properties to application-local.properties and remove them from the application.properties file:
        spring.datasource.url=jdbc:mysql://localhost/sample?useSSL=false        spring.datasource.username=root        spring.datasource.password=mohamed
  1. Create another file, application-cloud.properties, at src/main/resources/.
  2. Add the following properties to application-cloud.properties:
        spring.datasource.url=jdbc:mysql://<digital_ocean_ip>/sample?                                useSSL=false        spring.datasource.username=springboot spring.datasource.password=springboot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required