title: List of String Arrays overwriting itself
body: <p>First ever question here, complete newbie so try to take it easy on me. I'm trying to figure out what's wrong here:</p>
  
  <pre><code>public List&lt;String[]&gt; idOnlyQuery(String searchTerm, Connection conn){
  
      List&lt;String[]&gt; result = new ArrayList&lt;String[]&gt;();
      String[] rowResult = new String[7];
  
      Statement stmt = null;      
      try {
        stmt = conn.createStatement();
        ResultSet rs = stmt.executeQuery( "SELECT * FROM Jets WHERE CurrentID LIKE '" + searchTerm + "%'");
        while(rs.next()){
  
            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 baseAirport = rs.getString("Home_Airfield");
            rowResult[0] = (currentId);
            rowResult[1] = (manufacturer);
            rowResult[2] = (type);
            rowResult[3] = (series);
            rowResult[4] = (operator);
            rowResult[5] = (baseAirport);
            rowResult[6]= (index);
            result.add(rowResult);
        }
      System.out.println(result.get(0)[0]);
  </code></pre>
  
  <p>This method returns a list of string arrays, these arrays are retrieved from an SQLite database. Everything works apart from the fact that the string arrays in my result <code>List</code> seem to be getting overwritten every time the while loop repeats itself. The last <code>println</code> always gives me the <code>currentId</code> of the last row retrieved from the database, but if I put a <code>println</code> inside the <code>while</code> loop it returns the appropriate data on each while cycle. I really can't figure out where my <code>String[]</code> elements are getting overwritten. It's probably really obvious but I've spent hours looking online to check if I'm doing the add procedure correctly and still no joy. HELP!</p>