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
}
// 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