diff --git a/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java b/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java index 550dc81..5008fcc 100644 --- a/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java +++ b/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java @@ -140,7 +140,8 @@ public DataSourceConfig copy() { copy.customProperties = new LinkedHashMap<>(customProperties); } if (clientInfo != null) { - copy.clientInfo = new Properties(clientInfo); + copy.clientInfo = new Properties(); + copy.clientInfo.putAll(clientInfo); } copy.initSql = initSql; copy.alert = alert; diff --git a/ebean-datasource/src/main/java/io/ebean/datasource/pool/DriverDataSource.java b/ebean-datasource/src/main/java/io/ebean/datasource/pool/DriverDataSource.java index 96bf8b5..78e3fc7 100644 --- a/ebean-datasource/src/main/java/io/ebean/datasource/pool/DriverDataSource.java +++ b/ebean-datasource/src/main/java/io/ebean/datasource/pool/DriverDataSource.java @@ -42,7 +42,8 @@ static DataSource of(String name, DataSourceBuilder.Settings builder) { @Override public Connection getConnection(String username, String password) throws SQLException { - final var props = new Properties(connectionProps); + final var props = new Properties(); + props.putAll(connectionProps); props.setProperty("user", username); props.setProperty("password", password); return driver.connect(url, props); @@ -67,7 +68,8 @@ public Connection getConnection() throws SQLException { } private Connection switchCredentials(Properties properties) throws SQLException { - var copy = new Properties(properties); + var copy = new Properties(); + copy.putAll(properties); copy.setProperty("password", password2); var connection = driver.connect(url, copy); // success, permanently switch to use password2 from now on