你的if ( Rs.next()) 执行后就游标就已经滚动到第二条了!这样改:<%
String sql_sel_type="select * from table";
Rs=Stmt.executeQuery(sql_sel_type);
if(Rs==null)
  {out.print("Sorry,还没有栏目");}
else
  {
   while(Rs.next())
    {
     id=Rs.getString(1);
     type=Rs.getString(2);
    }
  }
%>