jsp下降不工作!!请协助

时间:2013-04-12 07:07:11

标签: database jsp drop-down-menu resultset

// resultset,resultset2与rsmd(ResultSetMetaData对象)&数据库连接也已正确定义 // tr&表格标签....

    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>
    <%
    }

.......剩余代码

1 个答案:

答案 0 :(得分:1)

row!= column

请从

更改
for( 

while( 

getString(i) 

getString(1)

请改用JSLT-SQL。