Hello,

I am having a jsp form which lists the employee and his sub in a form. By default, there will be 5 rows and the first row will show the employee information. The first row will have the employee information (name and dob) and the other rows will list the subs for the employee if they exist(S1, S2, S3, S4) and their names and Dob. If the data is there, they will show it, otherwise blank values will be shown. Below is my code, however in one of the cases, the Employee Name & the DOB is not stored in the DB but I want to show that they are "None" (The first row should have None values). The 2nd row should retrieve the Sub information(ex.S1) and should start from the (2nd) row not the first one which will display the name and the dob. For the 3rd row, the S2 will be displayed along with the values if they exist in the DB, otherwise blank. So can anyone assists in resolving the issue as my below code will only show None for the Employee information and will not retrieve the sub information for S1 as there will be data stored for it for the name and dob.
Java Code:
String RelationTitle = "Employee";
String RelationShip = "E";
for (int i =1; i<=5; i++)
    {

    String Name = "";
    String Dob = "";


       if (myResultSet.next())
          {

        RelationShip = myResultSet.getString("RELATIONSHIP"); 
            if (!RelationShip.equals("E"))
                {

                Name = "None";
                Dob = "None";
                }
                else
                {
                Name = myResultSet.getString("NAME");
                Dob = myResultSet.getString("Dob"); 
                }

                 }  

        %>

        <tr>
            <td width="1%" 
            <input type="checkbox" id="depen<%=i%>" value="<%=RelationShip%>" >
            </td>
            <td width="4%"> <%=RelationTitle%>
            </td>
            <td width="9%">
            <input type="text" id="name<%=i%>"  value="<%=Name%>">
            </td>
            <td width="9%">
            <input type="text" id="dob<%=i%>"  value="<%=Dob%>">
            </td>

        </tr>

        <%


           if (RelationShip.equals("E"))
               { 
                 RelationShip = "S" + i;
                 RelationTitle = "Sub";

               }
           else
               {    
                  RelationShip = "S" + i;
               }

         }