title: Why only the last value that we are trying to add is stored in an arraylist repeatedly
body: <p>I am retrieving each and every value of a single record and copying it into another array variable and setting array using a bean class and then adding that bean class to an arraylist.While I am trying to print it shows only the last record repeatedly</p>
  
  <pre><code>try{
      st=con.createStatement();
      rs=st.executeQuery("select * from data");
      while(rs.next()){
          DataBean db=new DataBean();
          for(int i=1;i&lt;=tNumber;i++){
              a[i]=rs.getFloat(i);
          }
          db.setArray(a);
          al.add(db);
     }
  } finally {
      ...
  } 
  </code></pre>