Skip to content

Commit 8921bb0

Browse files
Fixes #1137 support changing user/password at runtime for DriverDataSource-wrapped driver connections.
1 parent 851e2d4 commit 8921bb0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/com/zaxxer/hikari/util/DriverDataSource.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ public Connection getConnection(final String username, final String password) th
125125
final Properties cloned = (Properties) driverProperties.clone();
126126
if (username != null) {
127127
cloned.put("user", username);
128-
cloned.put("username", username);
128+
if (cloned.containsKey("username")) {
129+
cloned.put("username", username);
130+
}
129131
}
130132
if (password != null) {
131133
cloned.put("password", password);

0 commit comments

Comments
 (0)