title: How to convert a list of objects to a multi-dimensional array
body: <p>I have a list of objects (result from a select query), I want to convert it into an array and I want to put each column of the query in a column in the array. I have tried many solutions in the forum but I haven't found a solution.</p>
  
  <p>In my bean I have the following list:</p>
  
  <pre><code>private List&lt;PhBonCmd&gt; listEntree; // The PhBonCmd is an object model imported  has attributes like codeprod , quant ,...
  .....
  String sql ="select c.codeprod as codeprod , c.quant as quant ,c.date_cmd as date_cmd, c.date_expir as date_expir,c.numbco as numbco, c.auteur as auteur,"
              +"c.idcmd as idcmd ,f.nomfourn as nomfourn ,coalesce(c.quant_livre, 0) as quant_livre ,m.libelle as libelle "
              +"from commandes c,listeproduit m,fournisseur f "
              +"where c.codeprod=m.codeproduit and c.fourn=f.idfourn and c.statut='IN' and c.numbco ='"+getNumbco()+"' ";
  
     listEntree =  (List&lt;PhBonCmd&gt;) this.bcService.execRequete(sql);//Here the results of the sql query
  </code></pre>
  
  <p>Now what I want is to put each column of the List (<code>listEntree</code>) in a multidimensional arraylist, so as if I want to access to a specific single value in of the arraylist, I do so.</p>