Skip to content

Commit

Permalink
AbstractDriverBasedDataSource does not rely on Properties chaining an…
Browse files Browse the repository at this point in the history
…ymore

Issue: SPR-9461
  • Loading branch information
jhoeller committed Jan 18, 2013
1 parent 87968e5 commit 5d9ad5b
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,18 @@ public Connection getConnection(String username, String password) throws SQLExce
* @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);
}

/**
Expand Down

0 comments on commit 5d9ad5b

Please sign in to comment.