Author: kostat
Date: 2006-05-25 12:10:53 -0400 (Thu, 25 May 2006)
New Revision: 61122

Modified:
   
trunk/mcs/class/System.Data/Mainsoft.Data.Jdbc.Providers.jvm/GenericProvider.cs
Log:
merge -r 61099:61100

Modified: 
trunk/mcs/class/System.Data/Mainsoft.Data.Jdbc.Providers.jvm/GenericProvider.cs
===================================================================
--- 
trunk/mcs/class/System.Data/Mainsoft.Data.Jdbc.Providers.jvm/GenericProvider.cs 
    2006-05-25 16:08:54 UTC (rev 61121)
+++ 
trunk/mcs/class/System.Data/Mainsoft.Data.Jdbc.Providers.jvm/GenericProvider.cs 
    2006-05-25 16:10:53 UTC (rev 61122)
@@ -80,6 +80,8 @@
 
                        internal java.sql.Connection Connection {
                                get {
+                                       java.util.Properties properties = new 
java.util.Properties ();
+
                                        string url = 
(string)_keyMapper["JdbcURL"];
                                        if (url == null) {
                                                string jdbcUrlPattern = 
(string)_provider.ProviderInfo [ConfigurationConsts.JdbcUrlPattern];
@@ -91,9 +93,39 @@
                                                MatchEvaluator evaluator = new 
MatchEvaluator (ReplaceEvaluator);
                                                url = 
JdbcUrlPatternRegex.Replace (jdbcUrlPattern, evaluator);
                                        }
+                                       else {
+                                               // hack for backward 
comatibility:
+                                               // if the connection string 
contains 'Provider',
+                                               // the following mapping will 
hold:
+                                               // 'User', 'User Id' --> 'user'
+                                               // 'Password' --> 'password'
+                                               if (_keyMapper["Provider"] != 
null) {
 
-                                       java.util.Properties properties = new 
java.util.Properties ();
+                                                       const string USER = 
"User";
+                                                       const string USERID = 
"User Id";
+                                                       const string PASSWORD = 
"Password";
 
+                                                       string user = 
(string)_keyMapper[USER];
+                                                       if (user != null) {
+                                                               
properties.put("user", user);
+                                                               
_excludedKeys.Add(USER);
+                                                       }
+                                                       else {
+                                                               user = 
(string)_keyMapper[USERID];
+                                                               if (user != 
null) {
+                                                                       
properties.put("user", user);
+                                                                       
_excludedKeys.Add(USERID);
+                                                               }
+                                                       }
+
+                                                       string password = 
(string)_keyMapper[PASSWORD];
+                                                       if (password != null) {
+                                                               
properties.put("password", password);
+                                                               
_excludedKeys.Add(PASSWORD);
+                                                       }
+                                               }
+                                       }
+
                                        if (_provider._excludedKeys != null)
                                                
_excludedKeys.AddRange(_provider._excludedKeys);
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to