我编了一个jsp文件,老是出错,我知道是变量的问题可是不知道怎么解决。希望大家不吝赐教!初学<%@ page contentType="text/html;charset=gb2312"%>
<%@ include file="Connection.jsp"%>
<HTML>
<BODY bgcolor="#72bc95">
<FORM action="update.jsp" method=post>
输入姓名:<Input type="text" name="name"><BR>
输入新的学分:<Input type="text" name="xuefen" size="14"><BR><BR>
<Input type="submit" name="b" value="提交更新">
</FORM>
<P>师资信息更新前的记录是:
<% ResultSet rs=stm.executeQuery("select * from student");
%>
<TABLE border="" bgcolor="#74bbc0">
   <TBODY>
 <tr>
  <th width="100">学号</th>
  <th width="100">姓名</th>
  <th width="50">学分</th>
 </tr>
<%  while(rs.next()){%>
      <tr align="center">
      <td><%=rs.getString("学号")%></td>
      <td><%=rs.getString("姓名")%></td>
      <td><%=rs.getInt("学分")%></td>
      </tr>
<%
  }
 %>
</tbody>
</table>
<%  con.close(); %>
</body>
</html>Connection文件
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="  http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>数据库连接</title>
</head>
<%
try
    {
      Driver DriverRecordset1=(Driver)Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
  //加载驱动
      Connection con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=tt","sa","");
  //得到连接
      Statement stm=con.createStatement();
  //创建Statement
      }
    catch(java.sql.SQLException sqle) {
      out.println(sqle);
    }
    catch(Exception e) {
      out.println(e);
    }
%>
<body>
</body>
</html>