assert logger != null;
assert source != null;
try {
final IDataSet dataSet = loadDataSet(source);
final IDatabaseConnection connection = new DatabaseDataSourceConnection(
((SQLDatabase)database).getDataSource());
final Boolean qualifiedTableNames = source.getQualifiedTableNames();
if (qualifiedTableNames != null) {
final DatabaseConfig config = connection.getConfig();
config.setProperty(
DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES,
source.getQualifiedTableNames());
}
try {
DatabaseOperation.INSERT.execute(connection, dataSet);
} finally {
connection.close();
}
} catch (final SQLException exception) {
final String message = MessageUtil.getMessage(ERROR_PROCESSING_SOURCE_FILE, source.getSourceFile());
logger.logError(message, exception);
} catch (final DatabaseUnitException exception) {