<select>      
<%
     String book_cbs;

ResultSet RS1 = workM.executeQuery("select * from book_cbs");
while(RS1.next())
{


book_cbs=getStr(RS1.getString("cbs_name"));
if (book_cbs==null)
book_cbs="空";

     %>
            <option value="<%=book_cbs%>"><%=book_cbs%></option>
            
 <%
       
}
%>          </select>

解决方案 »

  1.   

    <select>
    <%
         String book_cbs;

    ResultSet RS1 = workM.executeQuery("select * from book_cbs");
    try
    {
    while(RS1.next())
    {


    book_cbs=getStr(RS1.getString("cbs_name"));
    if (book_cbs==null)
    book_cbs="空";

         %>
                <option value="<%=book_cbs%>"><%=book_cbs%></option>
           <%
           
    }
    }
    catch(Exception e)
    {
    out.println(e);
    }
           %>
    </select>
      

  2.   

    <select>
    <%
         String book_cbs;

    ResultSet RS1 = workM.executeQuery("select * from book_cbs");
    try
    {
    while(RS1.next())
    {


    book_cbs=getStr(RS1.getString("cbs_name"));
    if (book_cbs==null)
    book_cbs="空";

         %>
                <option value="<%=book_cbs%>"><%=book_cbs%></option>
           <%
           
    }
    }
    catch(Exception e)
    {
    out.println(e);
    }
           %>
    </select>