Problem:
Externalize all 5 parameters, Database Host, port, database name, user name and password
-
Use typesafe config package -
libraryDependencies += "com.typesafe" % "config" % "1.3.0"
-
Use it to externalize parameters
-
Steps involved
-
Update build.sbt
-
import the package
import com.typesafe.config._
-
Create application.properties under src/main/resources
-
Use ConfigFactory.load to create config object
-
Use config.get methods to get the properties
Please provide the following details
- Contents of build.sbt
- .classpath line for typesafe config dependencies
- Code snippet from the program which will read externalized properties