Null check before we put username/password values in the Properties object, since null values are illegal.

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@427389 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marc Prud'hommeaux 2006-08-01 00:55:41 +00:00
parent 72398bcea0
commit 803e15990d
1 changed files with 11 additions and 4 deletions

View File

@ -81,10 +81,17 @@ public class SimpleDriverDataSource
throws SQLException {
Properties props = new Properties();
props.put("user",
username != null ? username : _connectionUserName);
props.put("password",
password != null ? password : _connectionPassword);
if (username == null)
username = _connectionUserName;
if (username != null)
props.put("user", username);
if (password == null)
password = _connectionPassword;
if (password != null)
props.put("password", password);
return getConnection(props);
}