Author: sebb
Date: Tue Sep  4 08:32:17 2007
New Revision: 572717

URL: http://svn.apache.org/viewvc?rev=572717&view=rev
Log:
Allow username to be omitted

Modified:
    
jakarta/jmeter/branches/rel-2-2/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java?rev=572717&r1=572716&r2=572717&view=diff
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
 Tue Sep  4 08:32:17 2007
@@ -176,6 +176,7 @@
                cfgKeepAlive.setValue(getCheckQuery());
                poolController.addChild(cfgKeepAlive);
 
+               String _username = getUsername();
                if (log.isDebugEnabled()) {
                        StringBuffer sb = new StringBuffer(40);
                        sb.append("Driver: ");
@@ -183,7 +184,7 @@
                        sb.append(" DbUrl: ");
                        sb.append(getDbUrl());
                        sb.append(" User: ");
-                       sb.append(getUsername());
+                       sb.append(_username);
                        log.debug(sb.toString());
                }
                DefaultConfiguration cfgDriver = new 
DefaultConfiguration("driver");
@@ -192,12 +193,15 @@
                DefaultConfiguration cfgDbUrl = new 
DefaultConfiguration("dburl");
                cfgDbUrl.setValue(getDbUrl());
                config.addChild(cfgDbUrl);
-               DefaultConfiguration cfgUsername = new 
DefaultConfiguration("user");
-               cfgUsername.setValue(getUsername());
-               config.addChild(cfgUsername);
-               DefaultConfiguration cfgPassword = new 
DefaultConfiguration("password");
-               cfgPassword.setValue(getPassword());
-               config.addChild(cfgPassword);
+
+               if (_username.length() > 0){
+                       DefaultConfiguration cfgUsername = new 
DefaultConfiguration("user");
+                       cfgUsername.setValue(_username);
+                       config.addChild(cfgUsername);
+                       DefaultConfiguration cfgPassword = new 
DefaultConfiguration("password");
+                       cfgPassword.setValue(getPassword());
+                       config.addChild(cfgPassword);
+               }
 
                // log is required to ensure errors are available
                excaliburSource.enableLogging(new LogKitLogger(log));



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to