I am creating a properties file to connect to the database. I gave the path to the file, and I save the properties using the function:
public void setProperty(String key, String value) {
properties.setProperty(key, value);
}
I set the following properties:
"url","jdbc:mysql://localhost:3306/";"dbname","example";"user", "postgres";"Pass","123";
My question is, when I use my application on another system, how this property file can be useful (in fact, I went through the "properties file in java", but could not understand how they are used).
In the new system, the username and password will be different, so how can this file be useful?
source
share