提交 d5575609 authored 作者: Thomas Mueller's avatar Thomas Mueller

Don't close the statement

上级 b023ccbf
......@@ -155,9 +155,9 @@ public class RunScript extends Tool {
* @return the last result set
*/
public static ResultSet execute(Connection conn, Reader reader) throws SQLException {
// can not close the statement because we return a result set from it
Statement stat = conn.createStatement();
ResultSet rs = null;
try {
ScriptReader r = new ScriptReader(reader);
while (true) {
String sql = r.readStatement();
......@@ -176,9 +176,6 @@ public class RunScript extends Tool {
rs = stat.getResultSet();
}
}
} finally {
JdbcUtils.closeSilently(stat);
}
return rs;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论