InternalDerbyDatabase internalDatabase = createInternalDatabaseFromBackup(backupLocation);
return internalDatabase;
} catch (SQLException e) {
throw new DatabaseCopyException("A problem occurred while attempting to copy the database.", e);
} catch (DatabaseCreationException e) {
throw new DatabaseCopyException("A problem occurred while attempting to copy the database.", e);
} finally {
DatabaseUtilities.closeConnectionQuietly(connection);
}
} else {
throw new DatabaseCopyException("Unable to copy external databases!");
}
}