title: getting specific row values of database table into an arraylist
body: <p>I am trying to get certain row records from a db_table into an array list. though this has been done many times, mine is a bit more different.
  suppose I have a table in my database like this below:</p>
  
  <pre><code>    +---------+--------+--------+
      |  NAME   | BILL   | CONTACT|
      +---------+--------+--------+
      |  james  |   400  | 024669 |            
      |  Mavis  |   700  | 025550 |              
      |  john   |   650  | 029510 |         
      |  bendo  |   340  | 023579 |
      +---------+--------+--------+
  </code></pre>
  
  <p>and I want an array to display records like this:</p>
  
  <pre><code>[james,400,024669]
  [Mavis,700, 025550]
  [John,650, 029510]
  [bendoo,340,023579] 
  </code></pre>
  
  <p>please how do I achieve that. the code I wrote gave me only a last array. and its:</p>
  
  <pre><code>    ArrayList&lt;String&gt; inner = null;
  
      try{
      String sql="select Name,Score,Contact from members";
      pst=conn.prepareStatement(sql);
      rs=pst.executeQuery();
      ResultSetMetaData rsmd = rs.getMetaData();
      int columnsNumber = rsmd.getColumnCount();
      while (rs.next()) {
      inner = new ArrayList&lt;&gt;(); 
      for(int i=1; i&lt;=columnsNumber; i++){
      inner.add(rs.getString(i));
      }    
  
  }
          System.out.println(inner);
      }catch(Exception e){
  }
  </code></pre>
  
  <p>but this is the only System.out.PrintIn displayed:<br/></p>
  
  <pre><code>[bendoo,340,023579]
  BUILD SUCCESSFUL (total time: 2 minutes 13 seconds)
  </code></pre>
  
  <p>please how do I get this below as my result:</p>
  
  <pre><code>[james,400,024669]
  [Mavis,700, 025550]
  [John,650, 029510]
  [bendoo,340,023579] 
  </code></pre>