title: Jtable data retrieval problem in swing java
body: <p>I want to retrieve data in jtable from MySQL database everything is right but the data present at index 1 are not shown plz loo image 1 and 2.</p>
  <p>jtable img 1:</p>
  <p><a href="https://i.stack.imgur.com/PpXeo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PpXeo.png" alt="https://i.stack.imgur.com/PpXeo.png" /></a></p>
  <p>MySQL table img2:</p>
  <p><a href="https://i.stack.imgur.com/20t82.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/20t82.png" alt="https://i.stack.imgur.com/20t82.png" /></a></p>
  <pre><code> public void view_librarian() throws SQLException {
          prepareStatement = connection.prepareStatement(&quot;select * from librarian&quot;);
          ResultSet rs = prepareStatement.executeQuery();
          DefaultTableModel tm = (DefaultTableModel) table.getModel();
          table.setFont(new Font(&quot;Serif&quot;, Font.PLAIN, 25));
          table.setRowHeight(35);
          table.getTableHeader().setFont(new Font(&quot;Arial&quot;, Font.BOLD, 25));
          tm.setRowCount(0);
          if (rs.next()) {
              while (rs.next()) {
                  Object o[] = {rs.getString(&quot;username&quot;), rs.getString(&quot;name&quot;), rs.getString(&quot;mobile&quot;), rs.getString(&quot;email&quot;), rs.getString(&quot;address&quot;), rs.getString(&quot;date_time&quot;)};
                  tm.addRow(o);
              }
          } else {
              JOptionPane.showMessageDialog(this, &quot;No data found&quot;);
          }
      }
  </code></pre>