Only try setting the username and password if they are non-null
Patch provided by Matt Passell
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@943434
13f79535-47bb-0310-9956-
ffa450edef68
String driverURL = poolProperties.getUrl();
String usr = poolProperties.getUsername();
String pwd = poolProperties.getPassword();
- poolProperties.getDbProperties().setProperty("user", usr);
- poolProperties.getDbProperties().setProperty("password", pwd);
+ if (usr != null) {
+ poolProperties.getDbProperties().setProperty("user", usr);
+ }
+ if (pwd != null) {
+ poolProperties.getDbProperties().setProperty("password", pwd);
+ }
+
try {
connection = driver.connect(driverURL, poolProperties.getDbProperties());
} catch (Exception x) {