日期:2014-05-17  浏览次数:20754 次

页面修改数据后记录没有变化是怎么回事
xg.jsp 
 <%
request.setCharacterEncoding("gb2312");
String number=request.getParameter("id");
  Connection conn=(Connection)DatabaseConn.getConnection();
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select * from renyuan where id= "+number);  
  rs.next();
  %>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; 人员编号
  <label>
  <input type="text" name="textfield" value="<%=rs.getString("ry_id")%>">
  </label>
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; 人员姓名
  <input type="text" name="textfield2" value="<%=rs.getString("ry_name")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 性&nbsp; 别 
  <input type="text" name="textfield3" value="<%=rs.getString("ry_sex")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 国&nbsp; 籍 
  <input type="text" name="textfield4" value="<%=rs.getString("country")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 民&nbsp; 族 
  <input type="text" name="textfield5" value="<%=rs.getString("nation")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; 出生年月
  <input type="text" name="textfield6" value="<%=rs.getString("birthday")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; 电话号码
  <input type="text" name="textfield7" value="<%=rs.getString("telephone")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 年&nbsp; 龄 
  <input type="text" name="textfield8" value="<%=rs.getString("age")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; 工作时间
  <input type="text" name="textfield9" value="<%=rs.getString("worktime")%>">
  </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 等&nbsp; 级 
  <input type="text" name="textfield10" value="<%=rs.getString("ry_mj")%>">
  </p>
  <p> <br>
  </p>
  <form name="form1" method="post" action="xg1.jsp">
  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  <label>
  <input type="submit" name="Submit" value="提交">
  </label>
  </form>
  <p> <br>
  </p>

xg1.jsp 
<%  
try{
  request.setCharacterEncoding("gb2312");
  String number=request.getParameter("id");
  Connection conn=(Connection)DatabaseConn.getConnectio