DB_USERNAME=root
DB_PASSWORD=secretpassword
API_KEY=1234567890
import io.github.cdimascio.dotenv.Dotenv;
public class App {
public static void main(String[] args) {
String dbPassword = dotenv.get("DB_PASSWORD");
String apiKey = dotenv.get("API_KEY");
// ...
}
}
properties
DB_HOST=localhost
DB_PORT=3306