title: How to store each field data in string from List?
body: <p>I created a java class that fetch data from database and add to a list.and the methord dbd() return the List.</p>
  
  <pre><code>public class db {
    public List dbd() {
     List myList = new ArrayList();
          try {
              Class.forName("com.mysql.jdbc.Driver");
              Connection conn = DriverManager.getConnection("jdbc:mysql:*********,*******");
              Statement stmt2 = conn.createStatement();
              ResultSet rs2 = stmt2.executeQuery(" SELECT name_id,address,image from data where name="kiran";" )  ;
                   while(rs2.next())
                    {
                    myList.add(rs2.getString("name_id"));
                    myList.add(rs2.getString("address"));
                    myList.add(rs2.getString("image"));
                    }
  
          } catch (Exception ex) {
              System.out.println(ex);
          }
  
          return myList;
               }
  
      public static void main(String args[]){ 
  
       }
  
  }
  </code></pre>
  
  <p>in this jsp page i created object of db as nw. and by using  Iterator i can print all the field data from data base. </p>
  
  <pre><code> &lt;%
     db nw = new db();         
     Iterator it = nw.dbd().iterator();
     while (it.hasNext()) {
       out.println(it.next());
      }         
  
   %&gt;      
  </code></pre>
  
  <p><em><strong></em>****</strong> I NEED TO STORE EACH FIELD DATA TO STORE BACK TO INDIVIDUAL STRING LIKE name_id,address,image .. WHAT SHOULD I DO?</p>