<html>
<title>成绩查询主页面</title>
<body>
<%@page contentType = "text/html;charset=GB2312"
import = "java.sql.*"
%>
<font color = "green" size="4">
请选择您要查询成绩的学生姓名</font>
<hr>
<form action="ch9-6b.jsp" method="post">
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:webdata");
Statement smt =con.createStatement();
String sql = "select 姓名 from grades";
ResultSet rs=smt.executeQuery(sql);
out.println("<select size='1' name = 'name'>");
while(rs.next())
out.println("<option>" + rs.getString(1));
out.println("</select>");
con.close();
%>
<input type="submit" value="查询成绩">
</form>
</body>
</html>
<html>
<title>成绩查询结果</title>
<body>
<%@page contentType = "text/html;charset=GB2312"
import = "java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:webdata");
Statement smt = con.createStatement();
String name = new String(request.getParameter("name").getBytes("ISO-8859-1"));
String sql = "select * from grades where 姓名 ='" + name + "'";
String color;
ResultSet rs = smt.executeQuery(sql);
rs.next();
%>
<font color="blue" size="5">
<%=rs.getString(2)%>的成绩如下:</font><p>
语文:<%=rs.getInt(3)%><br>
英语:<%=rs.getInt(4)%><br>
数学:<%=rs.getInt(5)%><p>
<b>总分<%=rs.getInt(6)%></b><br>
</body>
</html>
这个程序只能查询不同名字的学生成绩 如果有相同姓名的学生的话应该怎么改啊 求教