]> git.mxchange.org Git - jaddressbook-share-lib.git/commitdiff
Method getProperty() now prefixes all keys with org.mxchange.addressbook.
authorRoland Haeder <roland@mxchange.org>
Wed, 29 Jul 2015 13:22:48 +0000 (15:22 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 29 Jul 2015 13:23:20 +0000 (15:23 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java
Addressbook/src/org/mxchange/addressbook/database/backend/mysql/MySqlDatabaseBackend.java
Addressbook/src/org/mxchange/addressbook/database/frontend/BaseDatabaseFrontend.java

index 50991963a6307e8404852849f0d054b960cfb5a5..87f2b6197db3ff29c8b89aaf22dd30caf2267c71 100644 (file)
@@ -165,13 +165,13 @@ public class BaseFrameworkSystem implements FrameworkInterface {
 
                // Init default values:
                // Default database backend
-               this.properties.put("org.mxchange.addressbook.database.backendType", "base64csv"); //NOI18N
+               this.properties.put("database.backendType", "base64csv"); //NOI18N
 
                // For MySQL backend
-               this.properties.put("org.mxchange.addressbook.database.mysql.host", "localhost"); //NOI18N
-               this.properties.put("org.mxchange.addressbook.database.mysql.dbname", "test"); //NOI18N
-               this.properties.put("org.mxchange.addressbook.database.mysql.login", ""); //NOI18N
-               this.properties.put("org.mxchange.addressbook.database.mysql.password", ""); //NOI18N
+               this.properties.put("database.mysql.host", "localhost"); //NOI18N
+               this.properties.put("database.mysql.dbname", "test"); //NOI18N
+               this.properties.put("database.mysql.login", ""); //NOI18N
+               this.properties.put("database.mysql.password", ""); //NOI18N
 
                // Trace message
                this.getLogger().trace("EXIT!"); //NOI18N
@@ -273,7 +273,7 @@ public class BaseFrameworkSystem implements FrameworkInterface {
         * @return Propety value
         */
        protected String getProperty (final String key) {
-               return this.properties.getProperty(key);
+               return this.properties.getProperty(String.format("org.mxchange.addressbook.%s", key)); //NOI18N
        }
 
        /**
index 212a78e823096100fe3ef3af8b2a0d9ae6c654dc..89e4c0dadb7fcc87a3329cd9318a900b697cf84d 100644 (file)
@@ -70,8 +70,8 @@ public class MySqlDatabaseBackend extends BaseDatabaseBackend implements Databas
 
                // Generate connection string
                String connect = String.format("jdbc:mysql://%s/%s", //NOI18N
-                               this.getProperty("org.mxchange.addressbook.database.mysql.host"), //NOI18N
-                               this.getProperty("org.mxchange.addressbook.database.mysql.dbname") //NOI18N
+                               this.getProperty("database.mysql.host"), //NOI18N
+                               this.getProperty("database.mysql.dbname") //NOI18N
                );
 
                // Debug message
@@ -80,8 +80,8 @@ public class MySqlDatabaseBackend extends BaseDatabaseBackend implements Databas
                // Now get a connection instance back
                MySqlDatabaseBackend.connection = DriverManager.getConnection(
                                connect,
-                               this.getProperty("org.mxchange.addressbook.database.mysql.login"), //NOI18N
-                               this.getProperty("org.mxchange.addressbook.database.mysql.password") //NOI18N
+                               this.getProperty("database.mysql.login"), //NOI18N
+                               this.getProperty("database.mysql.password") //NOI18N
                );
 
                // Trace message
index fafdb521151e9a1522360bc18a1bdac0d1274787..fb7818f8fb43bfc387f610c074da5977e4bfa4da 100644 (file)
@@ -72,7 +72,7 @@ public class BaseDatabaseFrontend extends BaseFrameworkSystem {
 
                // Read property
                // @TODO rewrite this to own properties file
-               String backendType = this.getProperty("org.mxchange.addressbook.database.backendType"); //NOI18N
+               String backendType = this.getProperty("database.backendType"); //NOI18N
 
                // Try it
                try {