更新时间:2021-06-29 08:37:26
解决方案:
需要使用System.getProperty
而不是System.getenv
.
String host = System.getProperty("RDS_HOSTNAME");
String port = System.getProperty("RDS_PORT");
String username = System.getProperty("RDS_USERNAME");
String password = System.getProperty("RDS_PASSWORD");
String dbname = System.getProperty("RDS_DB_NAME");
Java服务现在连接到数据库.
The Java service now connects to the database.