Loading data live into a grid fro from mysql database and updating componen

So in short, on the page i have 3 main elements at the moment, left multifileuploader, top nav, and right this grid that I’m having some issues with, I’ve read that you need a data provider but i haven’t really found anything on how it interacts with sql and jetty that i’m using for serving the pages.

What i want to implement is having the progress bar update the status live on progress, update buttons based on the status of each file and have it done seamlessly for the user.

How would i go about this? and how would i avoid any wacky behavior ? like

My code is currently

public static Grid<File_entry> uploadlist(String filter) {


    Grid<File_entry> grid = new Grid<>(File_entry.class);

    grid.setWidth("50%");


    grid.setItems(SQLInterface.converter_get_File_List(filter));


    grid.setColumns("filename", "size", "status");


    grid.addComponentColumn(file -> {
        if (file.getStatus().equals("Uploaded") || file.getStatus().equals("Uploading") || file.getStatus().equals("Failed")) {
            ComboBox<String> configSelector = new ComboBox<String>();
            configSelector.setItems(SQLInterface.converter_getconfiglist());
            configSelector.addValueChangeListener(event -> {
                        SQLInterface.converter_update_config_status(file.getId(), event.getValue());
                    }
            );
            return configSelector;
        } else {
            //TODO Make auto updating.

            ProgressBar progressBar = new ProgressBar();
            if ((file.getStatus().equals("Queue") || file.getStatus().equals("Starting"))) {
                progressBar.setIndeterminate(true);
            } else if ((file.getStatus().equals("Failed"))) {
                progressBar.addThemeVariants(ProgressBarVariant.LUMO_ERROR);
                progressBar.setMax(1);
                progressBar.setValue(1);
            } else {
                Converter_Status_Record record = SQLInterface.converter_get_progress_status(file.getId());
                progressBar.setMax(record.getTotalprogress());
                progressBar.setValue(record.getProgress());
            }
            return progressBar;
        }

    });


    //TODO Change to download or retry depending on status of file.
    grid.addComponentColumn(file -> {
        if (file.getStatus().equals("Uploaded") || file.getStatus().equals("Uploading")) {
            Button submit = new Button("Submit");
            submit.addClassName("Submit");
            submit.addClickListener(e -> {
                {

                    SQLInterface.converter_update_status(file.getId(), "submitted");
                    submit.setEnabled(false);

                }
            });
            if (!file.getStatus().equals("uploaded")) {
                submit.setEnabled(false);
            }
            return submit;
        } else if (file.getStatus().equals("Failed")) {
            Button resubmit = new Button("Resubmit");
            resubmit.addClassName("resubmit");
            resubmit.addClickListener(e -> {
                {

                    SQLInterface.converter_update_status(file.getId(), "submitted");
                    resubmit.setEnabled(false);

                }
            });
            return resubmit;
        } else {
            Button download = new Button("Download");
            download.addClassName("Download");
            download.addClickListener(e -> {
                {
                    //TODO download action.

                }
            });
            if (!file.getStatus().equals("Complete")) {
                download.setEnabled(false);
            }
            return download;
        }
    });
    return grid;

}