I want to display the data from MySQL in JTable but showed the last row from the table and more nothing. Help me, please. I understand that I have a problem because jt = new JTable(data, columns) each time create a new table for each row (deleting previous) but I can't find the right option.
public class Test2  extends JPanel {
    static final String USERNAME = "root";
    static final String PASSWORD = "root";
    static final String CONN_STRING = "jdbc:mysql://localhost:3306/mydbtest?useSSL=false";
    JTable jt;
    public Test2 () {
        try {
            Connection conn;
            conn = DriverManager.getConnection(CONN_STRING, USERNAME, PASSWORD);
            Statement stmt = (Statement) conn.createStatement();
            String query = "Select title, season, episode from movie";
            ResultSet rs = stmt.executeQuery(query);
            rs.beforeFirst();
            while (rs.next()) {
                String title = rs.getString("Title");
                String season = rs.getString("Season");
                String episode = rs.getString("Episode");
            String[] columns = {"Title", "S", "E"};
            String[][] data = {{title, season, episode}};
            jt = new JTable(data, columns);
            };
            jt.setPreferredScrollableViewportSize(new Dimension(450, 63));
            jt.setFillsViewportHeight(true);
            JScrollPane jps = new JScrollPane(jt);
            add(jps);
        }
        catch (Exception er) {System.err.println(er);}
    }
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        Test2 t = new Test2();
        jf.setTitle("Test");
        jf.setSize(500,500);
        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.add(t);
    }
}
 
     
    