try {
Class.forName(getDBClass()).newInstance();
connection = DriverManager.getConnection(getDBUrl(), user, password);
} catch (SQLException ex) {
logger.severe(null, ex);
throw new DatabaseException("Connecting to database failed!", ex);
} catch (InstantiationException ex) {
logger.severe(null, ex);
throw new DatabaseException("Instantiation of the database driver failed!", ex);
} catch (IllegalAccessException ex) {
logger.severe(null, ex);
throw new DatabaseException("Accessing the database driver failed!", ex);
} catch (ClassNotFoundException ex) {
logger.severe(null, ex);
throw new DatabaseException("Database driver not found!", ex);
}
}
}