From 522448987064559faa05b029276d17785313a7e5 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 29 Jul 2015 15:22:48 +0200 Subject: [PATCH] =?utf8?q?Method=20getProperty()=20now=20prefixes=20all=20?= =?utf8?q?keys=20with=20org.mxchange.addressbook.=20Signed-off-by:Roland?= =?utf8?q?=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/addressbook/BaseFrameworkSystem.java | 12 ++++++------ .../database/backend/mysql/MySqlDatabaseBackend.java | 8 ++++---- .../database/frontend/BaseDatabaseFrontend.java | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java b/Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java index 50991963..87f2b619 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 212a78e8..89e4c0da 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 fafdb521..fb7818f8 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 { -- 2.39.5