edit.jsp~6~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*" %>
- <%@ page language="java" %>
- <%@ page import="java.util.*" %>
- <%@ page import="proj112.*" %>
- <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
- <html>
- <body>
- <% request.setCharacterEncoding("gb2312"); %>
- <%
- String id2=request.getParameter("id");
- String stu_name = request.getParameter("stu_name");
- String stu_id = request.getParameter("stu_id");
- String sex = request.getParameter("sex");
- String dept = request.getParameter("dept");
- String mz = request.getParameter("mz");
- String zzmm = request.getParameter("zzmm");
- //int age2 = Integer.parseInt()
- String sql = "update student set stu_name='"+stu_name+"', stu_id='"+stu_id+"', sex='"+sex+"',dept='"+dept+"',mz='"+mz+"', zzmm='"+zzmm+"' where stu_name="+id2+" ";
- String rs2 = a.executeUpdate(sql);
- //rs2.close();
- a.close();
- response.sendRedirect("std.jsp");
- %>
- </body>
- </html>