Hi all,

I am working on the sample from java.sun.com/docs/books/tutorial/uiswing/examples/components/GenealogyExampleProject/src/components/GenealogyModel.java

Here's my while loop ,
Java Code:
try {
            String sql="Select * from folder";
            st=con.createStatement();
            rs=st.executeQuery(sql);
            list.add("Current Folders");
            while(rs.next()) {
                String folderName = rs.getString("folder_name");
                list.add(folderName);
               // System.out.println(folderName);
                //Person a1 = new Person(folderName);
                
            }
Then I want to put it into this way
Java Code:
 Object hierarchy[]=list.toArray();
            for(int i=1; i<hierarchy.length; i++) {
               Person a+i=new Person(hierarchy[i]);
     }
I do not know how I can assign the "Person a1, a2 depending on var i.
However, if I hardcoded it as below, it works fine.
Java Code:
Person a1 = new Person("Jack (great-granddaddy)");
Person a2 = new Person("Jean (great-granny)");
Can someone help me here?
Thank you