mirror of https://github.com/apache/openjpa.git
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:
parent
72398bcea0
commit
803e15990d
|
@ -81,10 +81,17 @@ public class SimpleDriverDataSource
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
|
|
||||||
props.put("user",
|
if (username == null)
|
||||||
username != null ? username : _connectionUserName);
|
username = _connectionUserName;
|
||||||
props.put("password",
|
|
||||||
password != null ? password : _connectionPassword);
|
if (username != null)
|
||||||
|
props.put("user", username);
|
||||||
|
|
||||||
|
if (password == null)
|
||||||
|
password = _connectionPassword;
|
||||||
|
|
||||||
|
if (password != null)
|
||||||
|
props.put("password", password);
|
||||||
|
|
||||||
return getConnection(props);
|
return getConnection(props);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue