AbstractDriverBasedDataSource does not rely on Properties chaining anymore

Issue: SPR-9461
This commit is contained in:
Juergen Hoeller
2013-01-18 19:07:46 +01:00
parent 245c61e278
commit f3d0beb955

View File

@@ -139,15 +139,18 @@ public abstract class AbstractDriverBasedDataSource extends AbstractDataSource {
* @see java.sql.Driver#connect(String, java.util.Properties)
*/
protected Connection getConnectionFromDriver(String username, String password) throws SQLException {
Properties props = new Properties();
props.putAll(getConnectionProperties());
Properties mergedProps = new Properties();
Properties connProps = getConnectionProperties();
if (connProps != null) {
mergedProps.putAll(connProps);
}
if (username != null) {
props.setProperty("user", username);
mergedProps.setProperty("user", username);
}
if (password != null) {
props.setProperty("password", password);
mergedProps.setProperty("password", password);
}
return getConnectionFromDriver(props);
return getConnectionFromDriver(mergedProps);
}
/**