⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 select.jsp

📁 java做的一个选课系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"  errorPage="" %>
<%@ page import="java.sql.*,db.DBBean" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>

<table>
	<tr><td>课程编号</td>
		<td>课程名称</td>
	</tr>	
<%
	String id = (String)session.getAttribute("id");
	if(id == null){
		response.sendRedirect("loginError.html");
	}
	else{
		String sql="select sel.courseId , c.name"  +
			"from student stu,course c,selection sel" +
			"where stu.id= '"+id+"' and sel.studentId=stu.id and sel.courseId=c.id";	
		DBBean db=new DBBean();
		ResultSet rs;
		rs=db.doQuery(sql);
		while(rs.next()){
			
%>			
	<tr><td><%=rs.getString(1) %>></td>
		<td><%=rs.getString(2) %></td>
	</tr>			
<% 
		}		
		db.close();
	}
%>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -