title: Add row in a JTable with autoincrement of the last row id
body: <p>My question is: how can I implement an "Add row" button which create a new row of a JTable (which gets the data from an SQLite database) with an autoincrement++ of the last row id.
  The id column has the already data autoincremented, and for now I know just to create a new row with all fields blank (without an increment++ of the newest row).
  Please, someone can help?</p>
  
  <pre><code>private void cmd_newrowActionPerformed(java.awt.event.ActionEvent evt) {
       ((DefaultTableModel) PrimaryTable.getModel()).addRow(new Vector());
  }
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>==================
  id  |  data      |
  ==================
  1   | some_data  |
  2   | some_data  |
  3   | some_data  |
  ==================
  
  
  After I press addRow button:
  
  ==================
  id  |  data      |
  ==================
  1   | some_data  |
  2   | some_data  |
  3   | some_data  |
  4   | blank      |        /// blank row data with an autoincrement of the row id
  ==================
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Ok, for now I get it how to insert a new row into database, but I don't know how to update the JXTable. So, the bellow code it works, and the new blank row it's updated after I restart the application. Someone can help me?</p>
  
  <pre><code>private void cmd_newrowActionPerformed(java.awt.event.ActionEvent evt) {
      try {
          String sql = "Insert into RDSSPrimaryTable (sample_no,mineral_name,chemical_formula,main_peaks,other_peaks,reference,link,comments,spectrum) values (?,?,?,?,?,?,?,?,?)";
  
          pst = conn.prepareStatement(sql);
          // no pst.setString for id - it takes automatically
  
          pst.setString(1, txt_sample_pt.getText());
          pst.setString(2, txt_mineral_pt.getText());
          pst.setString(3, txt_chemical_pt.getText());
          pst.setString(4, txt_main_pt.getText());
          pst.setString(5, txt_other_pt.getText());
          pst.setString(6, txt_reference_pt.getText());
          pst.setString(7, txt_link_pt.getText());
          pst.setString(8, txt_comments_pt.getText());
          pst.setBytes(9, person_image);
  
          JOptionPane.showMessageDialog(null, "Inserted");
      } catch (Exception e) {
          JOptionPane.showMessageDialog(null, e);
  
      }
  
      ((DefaultTableModel) PrimaryTable.getModel()).fireTableDataChanged(); // I tried this method even if the DefaultTableModel fire table automatically.
  
      PrimaryTable.repaint(); //tried also repaint, revalidate - nothing happens
  
  }
  </code></pre>