title: Reading a Access file using Jackcess and creating a Jtable with the data
body: <p>I'm currently working on a Java application that reads an Access file and builds a Jtable model using the data that's collected. I've previously done the same with an Excel file but when I tried with Jackcess it was slightly diffrent and I've ran into some questionmarks.</p>
  
  <p>My work so far:</p>
  
  <pre><code>public class AccessModel{
  
  public DefaultTableModel getAccessModel() throws IOException {
      Database db = DatabaseBuilder.open(new File("MyFile.accdb"));
  
      Vector&lt;String&gt; columnNames = new Vector&lt;String&gt;();
      Vector&lt;String&gt; vector = new Vector&lt;String&gt;();
      Vector&lt;Vector&lt;String&gt;&gt; data = new Vector&lt;Vector&lt;String&gt;&gt;();
  
      StringBuilder output = new StringBuilder();
  
              Table table = db.getTable("Table1");
  
      for (Column column : table.getColumns()) { // get the table column names
          output.append(column.getName());
          output.append("\n");
          columnNames.add(column.getName());
      }
      for (Column column : table.getColumns()) { // get the column rows and values
          vector.add(column.getRowValue(table.getNextRow()).toString());
      }
      data.add(vector);
  
      // return the model to Gui
      DefaultTableModel accessModel = new DefaultTableModel(data, columnNames);
      return accessModel;
      }
  }
  </code></pre>
  
  <p>As you can see this method will only iterate trough the first row, then exit the loop. I'm either blind to an abvious solution due to 12 hours of straight work, or I'm doing something terribly wrong. </p>
  
  <p>I've stumbled across some half-good solutions where an Iterator is used, but I cannot get the hang of it. Any suggestions on this? Or should I stay on lane with my current line of thought? </p>