<%@ page contentType="text/html; charset=iso8859_1" language="java" import="java.sql.*" errorPage="" %>
<html >
<head>
<title>无标题文档</title>
</head>
<body background="jpg/4.jpg">
<%
//String name = (String)session.getAttribute("student_id");
String a_courid2 = request.getParameter("a_courid");
//out.println(session.getAttribute("student_n"));
Connection con;
Statement sql;
ResultSet rs;
%>
<hr>
<br>
<form id="form1" name="form1" method="post" action="add_course.jsp">
<table border="1" align="center">
<tr>
<th>课程号</th>
<th>课程名称</th>
<th>学分</th>
<th>学时</th>
<th>教师</th>
<th>开课时间</th>
<th>适用专业</th>
<th>最大选课人数</th>
<th>是否考试</th>
</tr>
<tr>
<td><input type = "text" name = "course_id" size = "9"></td>
<td><input type = "text" name = "course_name" size = "10"></td>
<td><input type = "text" name = "credit_hour" size = "8"></td>
<td> <input type = "text" name = "course_time" size = "9">
<td><input type = "text" name = "teacher" size = "9"></td>
<td> <select name= select_time>
<option>--请选择--</option>
<option>第一学期</option>
<option>第二学期</option>
<option>第三学期</option>
<option>第四学期</option>
<option>第五学期</option>
<option>第六学期</option>
<option>第七学期</option>
<option>第八学期</option> </td>
<td><input type = "text" name = "by_who" size = "9"></td>
<td><input type = "text" name = "people" size = "15"></td>
<td><select name=exx><option>NO</option>
<option>YES</option> </select></td>
</tr>
</table>
<br>
<center><input type = submit value = "增加课程"/> </center>
</form>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=DriverManager.getConnection("jdbc:mysql://localhost/jsp?user=root&password=123456&useUnicode=true&characterEncoding=iso8859_1");
sql=con.createStatement();
rs=sql.executeQuery("SELECT * FROM course");
//out.print("已选");
//rs=sql.executeQuery("SELECT * FROM course");
out.print("<hr><br><form method=\"post\" action=\"amend.jsp?couid=" + a_courid2 +"\">");
out.print("<Table Border align='center'>");
out.print("<tr><td colspan=10 align= 'center'> 已有课程 </td></tr>");
out.print("<tr>");
out.print("<TH>课程操作");
out.print("<TH>课程号");
out.print("<TH>课程名字");
out.print("<TH>学分");
out.print("<TH>学时");
out.print("<Th>教师");
out.print("<TH>开课学期");
out.print("<TH>使用专业");
out.print("<TH>最大选课人数");
out.print("<TH>是否考试");
out.print("</tr>");
while(rs.next()){
out.print("<TR>");
String temp = rs.getString(1);
out.print("<td><a href = \"remove_course.jsp?course_id=" + temp +"\">删除</a> <a href = \"course_manage.jsp?a_courid=" + temp +"\">修改</a></td>");
if(a_courid2 != null && rs.getString(1).equals(a_courid2))//if(a_courid.equals("null"))
{
out.print("<TD><input type = \"text\" name = \"c_id\" value = " + rs.getString(1) + " size =8></TD>");
out.print("<TD><input type = \"text\" name = \"c_n\" value = " + rs.getString(2) + " size =8></TD>");
out.print("<TD><input type = \"text\" name = \"c_h\" value = " + rs.getString(3) + " size =8></TD>");
out.print("<TD><input type = \"text\" name = \"c_t\" value = " + rs.getString(4) + " size =8></TD>");
out.print("<TD><input type = \"text\" name = \"te\" value = " + rs.getString(5) + " size =8></TD>");
out.print("<TD><select name= s_t><option>请选择</option><option>第一学期</option><option>第二学期</option><option>第三学期</option><option>第四学期</option><option>第四学期</option><option>第六学期</option><option>第七学期</option><option>第八学期</option></TD>");
out.print("<TD><input type = \"text\" name = \"b_w\" value = " + rs.getString(7) + " size =8></TD>");
out.print("<TD><input type = \"text\" name = \"pe\" value = " + rs.getString(8) + " size =8></TD>");
out.print("<TD><select name=ex_am><option>NO</option> <option>YES</option> </select></TD>");
out.print("</TR>");
}
else
{//out.print(rs.getString(1)+a_courid+"1");
out.print("<TD>"+rs.getString(1)+"</TD>");
out.print("<TD>"+rs.getString(2)+"</TD>");
out.print("<TD>"+rs.getString(3)+"</TD>");
out.print("<TD>"+rs.getString(4)+"</TD>");
out.print("<TD>"+rs.getString(5)+"</TD>");
out.print("<TD>"+rs.getString(6)+"</TD>");
out.print("<TD>"+rs.getString(7)+"</TD>");
out.print("<TD>"+rs.getString(8)+"</TD>");
out.print("<TD>"+rs.getString(9)+"</TD>");
out.print("</TR>");
}
}
out.print("</Table><br>");
out.print("<center><input type = submit value = \"确认修改\"/></center>");
out.print("</form>");
}
catch(Exception e)
{
out.print(e.getMessage());
}
%>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
JSP学生选课系统
共32个文件
jsp:22个
jpg:8个
db:1个
3星 · 超过75%的资源 需积分: 11 164 下载量 139 浏览量
2008-07-24
22:31:33
上传
评论 3
收藏 858KB RAR 举报
温馨提示
JSP实现的学生选课系统,对学习JSP有帮助
资源推荐
资源详情
资源评论
收起资源包目录
学生选课系统.rar (32个子文件)
学生选课系统
代码
chengji.jsp 1KB
add_course.jsp 1KB
remove_student.jsp 1KB
admin_left.jsp 657B
course_info.jsp 2KB
hoice.jsp 2KB
choice.jsp 3KB
admin_pwd.jsp 3KB
amend.jsp 2KB
jpg
2.jpg 303KB
1.jpg 38KB
6.jpg 59KB
25.jpg 188KB
3.jpg 102KB
5.jpg 23KB
21.jpg 198KB
4.jpg 35KB
Thumbs.db 17KB
tuixuan.jsp 1KB
student.jsp 513B
admin.jsp 520B
login.jsp 2KB
index.jsp 1KB
xuanke.jsp 1KB
remove_course.jsp 919B
xuanke_manage.jsp 3KB
pwd.jsp 3KB
student_info.jsp 1KB
course_manage.jsp 5KB
left.jsp 592B
exit.jsp 177B
www.pudn.com.txt 218B
共 32 条
- 1
资源评论
- qq_319543912017-12-21怎么运行不起来
linchenxi
- 粉丝: 3
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功