association of radio buttons to table rows

Hi

I am using servlets to connect to a database and display it in the form of HTML table. I need to assign a radio button to each row. This table contains around 100 rows. THe radio button should be a column before "Name". How can I assign a radio button to each row without doing 100 times like

<input type=radio name="id" value="1"> <input type=radio name="id" value="2"> ...so on for each row because I am using result set to display the table.

while(rs.next())

{

out.println("<TR>");

out.println("<TD>" + rs.getString("NAME") +"</TD>");

out.println("<TD>" + rs.getString("PHONE") +"</TD>");

out.println("<TD>" + rs.getString("ADDRESS") +"</TD>");

out.println("<TD>" + rs.getString("ADDRESS") +"</TD>");

out.println("</TR>");

}

ex table:

Name Phone AddressState

asdasddasddasd

sadadasddasdsadas

sdadasdsadasdasd

Any help would be greatly appreciated

Thanks

[1533 byte] By [goBIGRED] at [2007-9-26 4:11:27]
# 1
You could do it in a loop...for (int i = 0; i < 100; i++) { <input type=radio name="id" value="<%=i%>">}Hope this helps!
fagane at 2007-6-29 13:16:22 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...