Skip to content

Commit cd8d72e

Browse files
committed
AbstractDriverBasedDataSource does not rely on Properties chaining anymore
Issue: SPR-9461
1 parent 8cf61c5 commit cd8d72e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/AbstractDriverBasedDataSource.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -109,7 +109,7 @@ public Properties getConnectionProperties() {
109109

110110

111111
/**
112-
* This implementation delegates to <code>getConnectionFromDriver</code>,
112+
* This implementation delegates to {@code getConnectionFromDriver},
113113
* using the default username and password of this DataSource.
114114
* @see #getConnectionFromDriver(String, String)
115115
* @see #setUsername
@@ -120,7 +120,7 @@ public Connection getConnection() throws SQLException {
120120
}
121121

122122
/**
123-
* This implementation delegates to <code>getConnectionFromDriver</code>,
123+
* This implementation delegates to {@code getConnectionFromDriver},
124124
* using the given username and password.
125125
* @see #getConnectionFromDriver(String, String)
126126
*/
@@ -139,7 +139,8 @@ public Connection getConnection(String username, String password) throws SQLExce
139139
* @see java.sql.Driver#connect(String, java.util.Properties)
140140
*/
141141
protected Connection getConnectionFromDriver(String username, String password) throws SQLException {
142-
Properties props = new Properties(getConnectionProperties());
142+
Properties props = new Properties();
143+
props.putAll(getConnectionProperties());
143144
if (username != null) {
144145
props.setProperty("user", username);
145146
}

0 commit comments

Comments
 (0)