From: Roland Haeder Date: Wed, 19 Aug 2015 12:43:12 +0000 (+0200) Subject: Added debug message X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d5375cc4792b6ba4752119f3664c0caa006ddf40;p=jcore.git Added debug message Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java b/src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java index ca318f2..7de1749 100644 --- a/src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java +++ b/src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java @@ -201,22 +201,25 @@ public abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implement protected void initBackend () throws UnsupportedDatabaseBackendException, SQLException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N - + // Try it try { // Try to get get instance from factory DatabaseBackend backend = BackendFactory.createInstance(this); - + + // Debug message + this.getLogger().debug(MessageFormat.format("backend={0}", backend)); + // Try to run a connect on it backend.connectToDatabase(); - + // All fine so far, then set it here this.setBackend(backend); } catch (final ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { // Continue to throw throw new UnsupportedDatabaseBackendException(ex); } - + // Trace message this.getLogger().trace("EXIT!"); //NOI18N } diff --git a/src/org/mxchange/jcore/factory/database/backend/BackendFactory.java b/src/org/mxchange/jcore/factory/database/backend/BackendFactory.java index 821779b..5e16166 100644 --- a/src/org/mxchange/jcore/factory/database/backend/BackendFactory.java +++ b/src/org/mxchange/jcore/factory/database/backend/BackendFactory.java @@ -48,6 +48,12 @@ public class BackendFactory extends BaseFrameworkSystem { // Trace message factory.getLogger().trace(MessageFormat.format("frontend={0} - CALLED!", frontend)); //NOI18N + // frontend must be set + if (frontend == null) { + // Is null + throw new NullPointerException("frontend is null"); + } + // Get property String className = factory.getProperty("database.backend.class"); //NOI18N