[求助]修改sql表信息,要嵌套的
我是分页显示信息的,当我要修改某条记录时,只要点击修改,那么所有关于这条(id)信息的记录就会显示出来,我们可以选择性的修改.但我点击时出现了这样的错误:Invalid operation for the current cursor position.点击修改的事件是<a href="pyxiugai.jsp?bianhao=<%=rs1.getString("bianhao")%>">修 改</a> ,但我点击删除这条信息时又可以,点击删除的事件是<a href="pydelete.jsp?bianhao=<%=rs1.getString("bianhao")%>">删除</a>.希望有高人相助
我的源代码是
<% request.setCharacterEncoding("gb2312");%>
<%
//连接数据库
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=company";
//pubs为你的数据库的
String user="sa";
String password="sa";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
//建立查询SQL语句
String bianhao=request.getParameter("bianhao");
String sql="select * from py_zl where bianhao='"+bianhao+"'";
ResultSet rs1=stmt.executeQuery(sql);//建立ResultSet对象
%>
<form name="form1" method="post" action="file:///G|/Tomcat5/webapps/ROOT/company/pyxiugai1.jsp">
<table width="72%" border="0" align="center" >
<tr bgcolor="#B3FFFF">
<td height="32" colspan="3"><div align="center"><strong><font size="4">聘用情况(<font color="#9900FF">修改</font>)</font></strong></div></td>
</tr>
<tr>
<td width="22%"><font size="3">编号(必填):</font></td>
<td width="54%"><input name="bianhao" type="text" value="<%=rs1.getString("bianhao")%>" id="bianhao2"></td>
<td width="24%" bgcolor="#DFDFDF"><span class="style1 style1">例如:20025101</span></td>
</tr>
<tr>
<td><font size="3">部门号:</font></td>
<td><input name="bumenhao " type="text" value="<%=rs1.getString("bumenhao")%>" id="bumenhao 2"></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">例如:1234568</span></td>
</tr>
<tr>
<td><font size="3">部门:</font></td>
<td><input name="bumen" type="text" value="<%=rs1.getString("bumen")%>" id="bumen2"></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">例如:人事部</span></td>
</tr>
<tr>
<td><font size="3">姓名:</font></td>
<td><input name="name" type="text" value="<%=rs1.getString("name")%>" id="name2"></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">例如:张三</span></td>
</tr>
<td><font size="3">聘用时间:</font></td>
<td><input name="pytime" type="text" value="<%=rs1.getDate("pytime")%>" id="pytime2"></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">例如:2002-1-1</span></td>
</tr>
<tr>
<td><font size="3">签约年限:</font></td>
<td><input name="qynxian" type="text" value="<%=rs1.getString("qynxian")%>" id="qynxian2"></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">例如</span><span class="style1">:三年</span></td>
</tr>
<tr>
<td><font size="3">所聘职位:</font></td>
<td><input name="spzwei" type="text" value="<%=rs1.getString("spzwei")%>" id="spzwei2"></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">例如</span><span class="style1">:经理</span></td>
</tr>
<tr>
<td><font size="3">自我评价:</font></td>
<td><textarea name="zwpjia" cols="40" value="<%=rs1.getString("zwpjia")%>" rows="5" id="textarea2"></textarea></td>
<td bgcolor="#DFDFDF"><span class="style1 style1">最多200字</span></td>
</tr>
<tr bgcolor="#B3FFFF">
<td height="32" colspan="3"><div align="center">
<input type="submit" name="Submit" value="修改">
<input type="reset" name="Submit2" value="重置">
</div></td>
</tr>
</table>
</form>