incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1341288 - in /incubator/lcf/trunk: CHANGES.txt framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Date Tue, 22 May 2012 01:44:34 GMT
Author: kwright
Date: Tue May 22 01:44:33 2012
New Revision: 1341288

URL: http://svn.apache.org/viewvc?rev=1341288&view=rev
Log:
Fix for CONNECTORS-476.

Modified:
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1341288&r1=1341287&r2=1341288&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Tue May 22 01:44:33 2012
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 0.6-dev =====================
 
+CONNECTORS-476: Allow for remote MySQL connections.
+(Shigeki Kobayashi, Karl Wright)
+
 CONNECTORS-472: Make changes related to graduation.
 (Karl Wright)
 

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java?rev=1341288&r1=1341287&r2=1341288&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Tue May 22 01:44:33 2012
@@ -29,7 +29,9 @@ public class DBInterfaceMySQL extends Da
 
   /** MySQL server property */
   public static final String mysqlServerProperty = "org.apache.manifoldcf.mysql.server";
-
+  /** Source system name or IP */
+  public static final String mysqlClientProperty = "org.apache.manifoldcf.mysql.client";
+  
   private static final String _driver = "com.mysql.jdbc.Driver";
   
   protected String cacheKey;
@@ -517,6 +519,11 @@ public class DBInterfaceMySQL extends Da
   public void createUserAndDatabase(String adminUserName, String adminPassword, StringSet
invalidateKeys)
     throws ManifoldCFException
   {
+    // Get the client property
+    String client =  ManifoldCF.getProperty(mysqlClientProperty);
+    if (client == null || client.length() == 0)
+      client = "localhost";
+
     // Connect to super database
 
     Database masterDatabase = new DBInterfaceMySQL(context,"mysql",adminUserName,adminPassword);
@@ -538,7 +545,7 @@ public class DBInterfaceMySQL extends Da
         try {
           list.clear();
           list.add(userName);
-          list.add("localhost");
+          list.add(client);
           list.add(password);
           masterDatabase.executeQuery("GRANT ALL ON "+databaseName+".* TO ?@? IDENTIFIED
BY ?",list,
             null,invalidateKeys,null,false,0,null,null);



Mime
View raw message