Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
Loading