<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY  >
<Font size=4>
<FORM action="newResult.jsp" method=post>
输入要修改成绩的同学的姓名：<BR>
<Input type="text" name="name">
<BR>输入新的操作系统成绩：
<Input type="text" name="math">
<BR>输入新的微机原理成绩：
<Input type="text" name="english">
<BR>输入新的数据结构成绩：
<Input type="text" name="physics">
<BR><Input type="submit" name="b" value="提交更新">
<P>数据库更新前的数据记录是：
 <% String name,number;
    int math,physics,english;
    Connection con;
    Statement sql; 
    ResultSet rs;
    try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       }
    catch(ClassNotFoundException e){out.print("abb"+e+"bb");}
    try{ con=DriverManager.getConnection("jdbc:odbc:aaa","","");
         sql=con.createStatement();
         rs=sql.executeQuery("SELECT * FROM student");
         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>");
             number=rs.getString(1); 
             out.print("<TD >"+number+"</TD>"); 
             name=rs.getString(2); 
             out.print("<TD >"+name+"</TD>");
             math=rs.getInt(3); 
             out.print("<TD >"+math+"</TD>"); 
             english=rs.getInt(4); 
             out.print("<TD >"+english+"</TD>");
             physics=rs.getInt(5); 
             out.print("<TD >"+physics+"</TD>");   
        out.print("</TR>") ; 
        }
        out.print("</Table>");
        con.close();
     }
   catch(SQLException e1) {out.print("aaaa"+e1+"aaaa"); }
 %>
</Font>
</BODY>
</HTML>
