<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
 <% Connection con;  
     Statement sql;  
     ResultSet rs;
    try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      }
    catch(ClassNotFoundException e){}
    try { con=DriverManager.getConnection("jdbc:odbc:star","","");
         sql=con.createStatement();
         rs=sql.executeQuery("SELECT * FROM 成绩 ");
         out.print("<Table Border>");
         out.print("<TR>");
            out.print("<TH width=100>"+"学号");
            out.print("<TH width=50>"+"姓名");
            out.print("<TH width=50>"+"操作系统");
	    out.print("<TH width=50>"+"微机原理");
	    out.print("<TH width=50>"+"数据结构");
         out.print("</TR>");
       while(rs.next())
       { out.print("<TR>");
            String xh=rs.getString(1); 
             out.print("<TD >"+xh+"</TD>");
            String  xm=rs.getString(2); 
             out.print("<TD >"+xm+"</TD>");
            String  cz=rs.getString(3); 
            out.print("<TD >"+cz+"</TD>");
	    String  wj=rs.getString(4); 
            out.print("<TD >"+wj+"</TD>");
            String  sj=rs.getString(5); 
            out.print("<TD >"+sj+"</TD>");
         out.print("</TR>") ;          
        }
        out.print("</Table>");
        con.close();
     }
   catch(SQLException e1) {}
 %>
</BODY>
</HTML>
