Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Program hangs when displaying a table with 2 or more rows

$
0
0
Why does the program hangs when displaying a table with 2 or more rows? It doesn't hang when it display only 1 row but after I tried adding 1 more
row through phpmyadmin and in the program itself it hangs.

Here's my display table:
   private void displayTable() {

        try {
            while (rs.next()) {//display table
                id = rs.getInt("id");
                name = rs.getString("name");
                course = rs.getString("course");
                bday = rs.getString("bday");
                age = rs.getString("age");
                bplace = rs.getString("bplace");
                status = rs.getString("status");
                gender = rs.getString("gender");
                add = rs.getString("address");
                model.insertRow(ctr, new String[]{Integer.toString(id), name, course, bday, age, add, bplace, status, gender});
                ctr = ctr + 1;
            }

        } 
        catch (SQLException err) {
            JOptionPane.showMessageDialog(Frame1.this, err.getMessage());
        }

  }


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>