title: Populate Java table with resultSet
body: <p>I'm building a java application that gets its data from an oracle database and puts it into a <code>JTable</code>. </p>
  
  <p>My problem is I am not able to populate the table, I don't understand how to do it. Javadoc is useless. </p>
  
  <p>I don't understand why the table doesn't get the rows:</p>
  
  <pre><code> if ((report.getMsg()=="selectEventoAll") &amp;&amp; (report.getEsito()==1))
      {
  
          DefaultTableModel dtm = new DefaultTableModel();
          eventi_tb.setModel(dtm);
  
          try
          {
              ResultSet res_eventi = report.getRes();
              i = 0;
              Object[][] datiEventi = new Object[report.getRowCount()][5];
  
              while(res_eventi.next())
              {
                 j = 0; 
                 while (j &lt; 5)
                 {
                    datiEventi[i][j] = res_eventi.getObject(j+2);
                    j++;
                 }
                 dtm.addRow(datiEventi[i]);
                 i++;
              }
          }
  </code></pre>