<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
  <% //获取提交的分数的最大值和最小值：
    String englishmax=request.getParameter("englishmax");
          if(englishmax==null)
            {englishmax="100";
            }
    String englishmin=request.getParameter("englishmin");
          if(englishmin==null)
            {englishmin="0";
            }
    String mathmax=request.getParameter("mathmax");
          if(mathmax==null)
            {mathmax="100";
            }
    String mathmin=request.getParameter("mathmin");
          if(mathmin==null)
            {mathmin="0";
            }
    Connection con=null;
    Statement sql=null;
    ResultSet rs=null;
       try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          }
       catch(ClassNotFoundException e){}
       try
      {    con=DriverManager.getConnection("jdbc:odbc:aaa","","");
           sql=con.createStatement();
           String eCondition="wjyl <= "+englishmax+" AND "+"wjyl >= "+englishmin;
           String mCondition="czxt <= "+mathmax+" AND "+"czxt >= "+mathmin;
           String condition="SELECT * FROM student WHERE "+mCondition+" and "+eCondition;
           rs=sql.executeQuery(condition);
       out.print("<Table Border>");
            out.print("<TR>");
            out.print("<TH width=100>"+"学号");
            out.print("<TH width=100>"+"姓名");
            out.print("<TH width=50>"+"操作系统");
            out.print("<TH width=50>"+"微机原理");
            out.print("<TH width=50>"+"数据结构");
            out.print("</TR>");
       while(rs.next())
           { out.print("<TR>");
             out.print("<TD >"+rs.getString(1)+"</TD>"); 
             out.print("<TD >"+rs.getString(2)+"</TD>");
             out.print("<TD >"+rs.getInt(3)+"</TD>"); 
             out.print("<TD >"+rs.getInt(4)+"</TD>");
             out.print("<TD >"+rs.getInt(5)+"</TD>");   
             out.print("</TR>") ;          
            }
       out.print("</Table>");
      con.close();
     }
   catch(SQLException e)
          {}
%>
</BODY>
</HTML>
