MCPcopy Create free account
hub / github.com/diyhi/bbs / importSQL

Method importSQL

src/main/java/cms/utils/SqlFile.java:28–44  ·  view source on GitHub ↗

导入SQL文件 @param connection 数据库连接 @param content SQL内容

(Connection connection, Reader content)

Source from the content-addressed store, hash-verified

26 * @param content SQL内容
27 */
28 public static void importSQL(Connection connection, Reader content) throws Exception {
29 if(connection == null){
30 return;
31 }
32
33 SqlScriptRunner runner = new SqlScriptRunner(connection);
34 //错误是否抛出异常
35 runner.setThrowException(true);
36 //执行错误输出
37 runner.setErrorLogWriter(null);
38 //执行输出
39 runner.setLogWriter(null);
40 //执行脚本
41 runner.runScript(content);
42
43
44 }
45
46 /**
47 * 导入SQL文件

Callers 2

installMethod · 0.95
addMethod · 0.95

Calls 5

setThrowExceptionMethod · 0.95
setErrorLogWriterMethod · 0.95
setLogWriterMethod · 0.95
runScriptMethod · 0.95
getResourceAsReaderMethod · 0.95

Tested by 1

installMethod · 0.76