diff --git a/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java b/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java index efb742fb2cba..97fd2a41ed17 100644 --- a/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java +++ b/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java @@ -2369,8 +2369,8 @@ public void finishBundle() throws Exception { cleanUpStatementAndConnection(); } - @Override - protected void finalize() throws Throwable { + @Teardown + public void tearDown() throws Exception { cleanUpStatementAndConnection(); }