Java Code Examples for org.apache.ibatis.jdbc.ScriptRunner#setFullLineDelimiter()
The following examples show how to use
org.apache.ibatis.jdbc.ScriptRunner#setFullLineDelimiter() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchemaInitSystemStrategy.java From zuihou-admin-boot with Apache License 2.0 | 6 votes |
@SuppressWarnings("AlibabaRemoveCommentedCode") public ScriptRunner getScriptRunner() { try { Connection connection = this.dataSource.getConnection(); ScriptRunner runner = new ScriptRunner(connection); runner.setAutoCommit(false); //遇见错误是否停止 runner.setStopOnError(true); /* * 按照那种方式执行 方式一:true则获取整个脚本并执行; 方式二:false则按照自定义的分隔符每行执行; */ runner.setSendFullScript(true); // 设置是否输出日志,null不输出日志,不设置自动将日志输出到控制台 // runner.setLogWriter(null); Resources.setCharset(Charset.forName("UTF8")); // 设置分隔符 runner.setDelimiter(";"); runner.setFullLineDelimiter(false); return runner; } catch (Exception ex) { throw new BizException(-1, "获取连接失败"); } }
Example 2
Source File: SchemaInitSystemStrategy.java From zuihou-admin-cloud with Apache License 2.0 | 6 votes |
@SuppressWarnings("AlibabaRemoveCommentedCode") public ScriptRunner getScriptRunner() { try { Connection connection = this.dataSource.getConnection(); ScriptRunner runner = new ScriptRunner(connection); runner.setAutoCommit(false); //遇见错误是否停止 runner.setStopOnError(true); /* * 按照那种方式执行 方式一:true则获取整个脚本并执行; 方式二:false则按照自定义的分隔符每行执行; */ runner.setSendFullScript(true); // 设置是否输出日志,null不输出日志,不设置自动将日志输出到控制台 // runner.setLogWriter(null); Resources.setCharset(Charset.forName("UTF8")); // 设置分隔符 runner.setDelimiter(";"); runner.setFullLineDelimiter(false); return runner; } catch (Exception ex) { throw new BizException(-1, "获取连接失败"); } }