chakan11.jsp~6~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:2k
源码类别:
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>
- <head>
- <script language="javascript">
- function a(){alert("修改成功");}history.back();
- </script>
- <title>
- chakan1_1_1
- </title>
- </head>
- <body bgcolor="#ffffff">
- <br /> 学号:<font color="red"><%=session.getAttribute("stu_id") %></font> 课程号:<font color="red"><%=request.getParameter("id") %></font> 修改学生成绩:<br><br><hr>
- <%
- String stu_id=(String)session.getAttribute("stu_id");
- String kechenghao=request.getParameter("id");
- String sql="";
- sql="SELECT * FROM 成绩关联 where stu_id='"+stu_id+"' and 课程号='"+kechenghao+"'";
- ResultSet rs=a.executeQuery(sql);
- if(rs.next()){
- String cj=rs.getString("成绩");
- String cj2=rs.getString("重修成绩");
- %>
- <form action="chakan111.jsp" method="POST">
- <center>
- <br><br>原始成绩: <input type="text" name="cj" value="<%=cj%>">
- <br> <br><br>重修成绩: <input type="text" name="cj2" value="<%=cj2%>">
- <br><br /><br>
- <input type="submit" name="subit" value="确认" onclick="return a()"> <input type="reset" name="reset" value="重写">
- </center>
- </form>
- <%}
- session.setAttribute("stu_id",stu_id);
- session.setAttribute("kechenghao",kechenghao);
- %>
- </body>
- </html>