title: Create vector for DefaultTableModel
body: <pre><code>public static DefaultTableModel localQuery(String searchTerm){
  
      List&lt;String[]&gt; result = new ArrayList&lt;String[]&gt;();
      String[] rowResult = new String[7];
      Vector&lt;String[]&gt; rows = new Vector&lt;String[]&gt;();
      Vector&lt;String&gt; columnNames = new Vector&lt;String&gt;();
      Statement stmt = null;      
      try {
        stmt = conn.createStatement();
        ResultSet rs = stmt.executeQuery(searchTerm);
        while(rs.next()){
            rowResult = new String[13];
  
            String currentId= rs.getString("CurrentId");
            String manufacturer = rs.getString("Constructor");
            String type = rs.getString("ACType");
            String series = rs.getString("Series");
            String index = rs.getString("KeyNo");
            String operator = rs.getString("Operator");
            String baseCountry = rs.getString("Home_Country");
            String baseAirport = rs.getString("Home_Airfield");
            String cn = rs.getString("Con");
            String lineNo = rs.getString("LineNum");
            String hex = rs.getString("Hexcode");
            String selcal=rs.getString("Selcal");
            String acName = rs.getString("ACName");
  
            rowResult[0] = (currentId);
            rowResult[1] = (manufacturer);
            rowResult[2] = (type);
            rowResult[3] = (series);
            rowResult[4] = (operator);
            rowResult[5] = (baseCountry);
            rowResult[6] = (baseAirport);
            rowResult[7] = (cn);
            rowResult[8] = (lineNo);
            rowResult[9] = (hex);
            rowResult[10] = (selcal);
            rowResult[11] = (acName);
            rowResult[12]= (index);
            result.add(rowResult);
  
        }
  
      columnNames.add("Reg.");
      columnNames.add("Manufacturer");
      columnNames.add("Type");
      columnNames.add("Series");
      columnNames.add("Operator");
      columnNames.add("Home Country");
      columnNames.add("Home Airfield");
      columnNames.add("C/N");
      columnNames.add("Line #");
      columnNames.add("Hex");
      columnNames.add("Selcal");
      columnNames.add("Aircraft Name");
      columnNames.add("");
  
  
  
  
  
        rs.close();
        stmt.close();
  
  
      //Convert from List&lt;String[]&gt; to a suitable vector for  resultTable... Help!!!
  
  
    DefaultTableModel resultTable = new DefaultTableModel(rows, columnNames);
    return resultTable;
  
      }
  </code></pre>
  
  <p>Hi! I'm trying this method to return a DefaultTableModel to use on a JTable. I'm struggling to format the data pulled from the database into a model friendly format. Take it easy on me, this is my third ever day of programming of any sort!</p>
  
  <p>Thanks in advance :)</p>