diff --git a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java index 67a0cf5a636b34..5f132871a0c8ae 100644 --- a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java +++ b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java @@ -99,6 +99,9 @@ public BaseJdbcExecutor(byte[] thriftParams) throws Exception { } public void close() throws Exception { + if (outputTable != null) { + outputTable.close(); + } try { if (stmt != null && !stmt.isClosed()) { try { @@ -111,8 +114,8 @@ public void close() throws Exception { if (conn != null && resultSet != null) { abortReadConnection(conn, resultSet); } - closeResources(resultSet, stmt, conn); } finally { + closeResources(resultSet, stmt, conn); if (config.getConnectionPoolMinSize() == 0 && hikariDataSource != null) { hikariDataSource.close(); JdbcDataSource.getDataSource().getSourcesMap().remove(config.createCacheKey());