From: Roland Haeder Date: Wed, 29 Jul 2015 13:22:48 +0000 (+0200) Subject: Method getProperty() now prefixes all keys with org.mxchange.addressbook. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=522448987064559faa05b029276d17785313a7e5;p=jfinancials-swing.git Method getProperty() now prefixes all keys with org.mxchange.addressbook. Signed-off-by:Roland Häder --- diff --git a/Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java b/Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java index 5099196..87f2b61 100644 --- a/Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java +++ b/Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java @@ -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 } /** diff --git a/Addressbook/src/org/mxchange/addressbook/database/backend/mysql/MySqlDatabaseBackend.java b/Addressbook/src/org/mxchange/addressbook/database/backend/mysql/MySqlDatabaseBackend.java index 212a78e..89e4c0d 100644 --- a/Addressbook/src/org/mxchange/addressbook/database/backend/mysql/MySqlDatabaseBackend.java +++ b/Addressbook/src/org/mxchange/addressbook/database/backend/mysql/MySqlDatabaseBackend.java @@ -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 diff --git a/Addressbook/src/org/mxchange/addressbook/database/frontend/BaseDatabaseFrontend.java b/Addressbook/src/org/mxchange/addressbook/database/frontend/BaseDatabaseFrontend.java index fafdb52..fb7818f 100644 --- a/Addressbook/src/org/mxchange/addressbook/database/frontend/BaseDatabaseFrontend.java +++ b/Addressbook/src/org/mxchange/addressbook/database/frontend/BaseDatabaseFrontend.java @@ -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 {