@Override
    public synchronized void close() throws IOException {
        if (closed) {
            return;
        }
        closed = true;
        if (this.scheduledFuture != null) {
            scheduledFuture.cancel(false);
            this.scheduler.shutdown();
        }

        if (batchCount > 0) {
            flush();
        }

        try {
            if(jdbcWriter != null){
                jdbcWriter.close();
            }
        } catch (SQLException e) {
            LOG.warn("Close JDBC writer failed.", e);
        }

        closeDbConnection();
    }
Executes prepared statement and closes all resources of this instance.

@throws IOException Thrown, if the input could not be closed properly.
rdb/rdb-sink/src/main/java/com/dtstack/flink/sql/sink/rdb/format/JDBCUpsertOutputFormat.java