提交 5d9ad5b1 编写于 作者: J Juergen Hoeller

AbstractDriverBasedDataSource does not rely on Properties chaining anymore

Issue: SPR-9461
上级 87968e5a
......@@ -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);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册