From: Roland Haeder Date: Fri, 14 Aug 2015 12:29:58 +0000 (+0200) Subject: Sorted members X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b14817fd0a921186a1670646cdf800abb430c021;p=jcore.git Sorted members 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 0554f71..0d3f48f 100644 --- a/src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java +++ b/src/org/mxchange/jcore/database/frontend/BaseDatabaseFrontend.java @@ -107,35 +107,6 @@ public abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implement this.getLogger().trace("EXIT!"); } - /** - * Initialize backend - * - * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the backend is not supported - * @throws java.sql.SQLException If a SQL database backend fails to connect - */ - 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); - - // 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 - } - /** * Inserts currently filled dataset and returns the result of the operation. * This may return no rows, but the affectedRows field may have been @@ -163,4 +134,33 @@ public abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implement // Return it return result; } + + /** + * Initialize backend + * + * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the backend is not supported + * @throws java.sql.SQLException If a SQL database backend fails to connect + */ + 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); + + // 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 + } }