// resultset,resultset2 与 rsmd(ResultSetMetaData object) 一起正确定义 & DB 连接也正确定义 //tr & table tags....
String td_names[] ={"DVD","BOOKS","NOVELS"};
resultset=statement.executeQuery("SELECT * FROM mytable");
rsmd=resultset.getMetaData();
for(int j=0;j<td_names.length;j++)
{
%>
<td><%=td_names[j]%></td>
<%
resultset2=statement2.executeQuery("SELECT " + rsmd.getColumnName(j) + " FROM mytable");
%>
<td>
<select name='drop_'<%=j%> >
<%
for(int i=0;resultset2.next();i++)
{
%>
<option><%=resultset2.getString(i)%></option>
<%
}
%>
</select>
</td>
<%
}
.......剩余代码