提交 271ca0a2 authored 作者: LaughingMan's avatar LaughingMan

Move code out of try block

上级 3d024b5e
...@@ -124,7 +124,6 @@ public class CreateCluster extends Tool { ...@@ -124,7 +124,6 @@ public class CreateCluster extends Tool {
private static void performTransfer(Statement statSource, String urlTarget, private static void performTransfer(Statement statSource, String urlTarget,
String user, String password, String serverList) throws SQLException { String user, String password, String serverList) throws SQLException {
try (PipedReader pipeReader = new PipedReader()) {
// Delete the target database first. // Delete the target database first.
try (Connection connTarget = DriverManager.getConnection( try (Connection connTarget = DriverManager.getConnection(
...@@ -134,6 +133,7 @@ public class CreateCluster extends Tool { ...@@ -134,6 +133,7 @@ public class CreateCluster extends Tool {
statTarget.execute("DROP ALL OBJECTS DELETE FILES"); statTarget.execute("DROP ALL OBJECTS DELETE FILES");
} }
try (PipedReader pipeReader = new PipedReader()) {
Future<?> threadFuture = startWriter(pipeReader, statSource); Future<?> threadFuture = startWriter(pipeReader, statSource);
// Read data from pipe reader, restore on target. // Read data from pipe reader, restore on target.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论