📄 chengji.jsp
字号:
<%@ page contentType="text/html; charset=iso8859_1" language="java" import="java.sql.*" errorPage="" %>
<html >
<head>
<title>无标题文档</title>
</head>
<body>
<%
String course_i = request.getParameter("course_id2");
//String student_i = request.getParameter("student_id");
Connection con;
Statement sql,ss;
ResultSet rs;
try{
con=DriverManager.getConnection("jdbc:mysql://localhost/jsp?user=root&password=123456&useUnicode=true&characterEncoding=iso8859_1");
sql=con.createStatement();
ss = con.createStatement();
int i=1;
rs=sql.executeQuery("select a.student_id,a.student_name,c.course_name,c.course_id,result from student a, choice_course b, course c where a.student_id = b.student_id and c.course_id = b.course_id and c.course_id ='" +course_i+"'");
while(rs.next())
{
String resu = request.getParameter(rs.getString(1));
ss.executeUpdate("update choice_course set result = "+resu+" where course_id ='" + course_i +"' and student_id =" +rs.getString(1)+"");
}
sql.executeUpdate("update course set exam ='YES' where course_id ='"+course_i+"'");
}
catch(Exception e)
{
out.print(e.getMessage());
}
%>
<jsp:forward page ="hoice.jsp">
<jsp:param name="course_id1" value="<%=course_i%>"/>
</jsp:forward>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -