title: How do I can Iterate this structure from ArrayList
body: <p>I am pretty new on Java, and I'm wondering how to iterate this ArrayList </p>
  
  <pre><code>[
      [{ID_CLIENTE=1}, {CODIGO=001}, {NOMBRES=John}, {STA=1}], 
      [{ID_CLIENTE=2}, {CODIGO=003}, {NOMBRES=Laura },  {STA=1}]
  ]
  </code></pre>
  
  <p>this is an arraylist that contains a record on each row, and inside there is a value/pair for the column name and value, and draw only the selected columns on the column array. 
  This is my Java Code:</p>
  
  <pre><code>String columns = request.getParameter("columns");
  String[] cols =  columns.split(",");
  List&lt;ArrayList&lt;String&gt;&gt; mant =  mantDao.getAllMant(); // this return the arraylist shown above
  
      for(ArrayList&lt;String&gt; row: mant){
            //IF it is ON cols array 
            // response.getWriter().write("&lt;tr&gt;td&gt;"+row.get(index) +"&lt;/td&gt;"....); &lt;-- BAD CODE    
  
      }
  </code></pre>
  
  <p>Any help will be really apprecciated. I'm stuck on this for while.</p>
  
  <p>EDIT:
  this is the getAllMant() function</p>
  
  <pre><code>public List getAllMant() {        
      ArrayList mant = new ArrayList&lt;ArrayList&lt;String&gt;&gt;();
          try {
              Statement statement = connection.createStatement();
              ResultSet rs = statement.executeQuery(this.query);
  
          campos = this.getCampos();
              while (rs.next()) {
          ArrayList row = new ArrayList&lt;&gt;();
          for(List&lt;String&gt; campo: campos){
              LinkedHashMap&lt;String, String&gt; lhm = new LinkedHashMap&lt;String, String&gt;();
              String valueField = "";
              if( Arrays.asList(INTS).contains(Integer.parseInt(campo.get(1)) ) ){
              valueField = String.valueOf(rs.getInt(campo.get(0)));
              }else if( Arrays.asList(NUMBERS).contains(Integer.parseInt( campo.get(1)) ) ){
              valueField = String.valueOf(rs.getLong(campo.get(0)));
              }else if( Arrays.asList(VARCHAR).contains(Integer.parseInt( campo.get(1)) ) ){
              valueField = rs.getString(campo.get(0)) ;
              }else if( Arrays.asList(DATES).contains(Integer.parseInt( campo.get(1)) ) ){
              if(rs.getDate(campo.get(0)) !=null){
                  valueField = rs.getDate(campo.get(0)).toString();
              }else{
                  valueField = "";
              }
              }
              lhm.put(campo.get(0),valueField);
              row.add(lhm);
          }
          mant.add(row);
              }
          } catch (SQLException e) {
              e.printStackTrace();
          }
  
          return mant;
      }
  </code></pre>
  
  <p>regards</p>