This commit is contained in:
zyyang 2021-01-29 14:19:13 +08:00
parent 89a0add293
commit 89ab10f9ab
1 changed files with 4 additions and 2 deletions

View File

@ -20,8 +20,9 @@ public class TaosInfoMonitorTest {
List<Connection> connectionList = IntStream.range(0, 100).mapToObj(i -> { List<Connection> connectionList = IntStream.range(0, 100).mapToObj(i -> {
try { try {
TimeUnit.SECONDS.sleep(1);
return DriverManager.getConnection(url); return DriverManager.getConnection(url);
} catch (SQLException e) { } catch (SQLException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
@ -29,7 +30,8 @@ public class TaosInfoMonitorTest {
connectionList.stream().forEach(conn -> { connectionList.stream().forEach(conn -> {
try { try {
conn.close(); conn.close();
} catch (SQLException e) { TimeUnit.SECONDS.sleep(1);
} catch (SQLException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
}); });