String username = props.getProperty("username");
String password = props.getProperty("password");
PrintWriter outWriter = new PrintWriter(printStream);
UnpooledDataSource dataSource = new UnpooledDataSource(driverClassLoader, driver, url, username, password);
dataSource.setAutoCommit(false);
ScriptRunner scriptRunner = new ScriptRunner(dataSource.getConnection());
scriptRunner.setStopOnError(!force);
scriptRunner.setLogWriter(outWriter);
scriptRunner.setErrorLogWriter(outWriter);
setPropertiesFromFile(scriptRunner, props);
return scriptRunner;
} catch (Exception e) {
throw new MigrationException("Error creating ScriptRunner. Cause: " + e, e);
}