JSP课程设计学生在线选课系统
- 格式:doc
- 大小:782.00 KB
- 文档页数:22
JSP学生选课系统-课程设计JSP学生选课系统052 1. 一、实训目的计算机应用实训是计算机科学与技术专业重要的实践性教学课程,安排在毕业前最后一学期进行。
通过本次应用实训,使学生对结合学习过的知识,对软件开发过程进一步理解,并掌握按照软件工程的思想,进行程序开发设计的过程,同时培养学生严谨、科学的工作作风,为今后从事计算机工作打下必要的基础。
通过本次实训,使学生掌握程序设计中需求分析、概要设计、详细设计的方法和过程,并通过实际学习,利用Eclipse3+MyEclipse6+JDK6开发环境,实现基于JSP环境下采用Model1模式程序的编制。
2. 二、设计题目编号题目备注1 图书管理系统2 人事管理系统3 教材管理系统4 学生管理系统5 工资管理系统6 库存管理系统7 IC卡管理系统8 科技文献管理系统3. 三、分组原则原则上每组人数不超过5人,在班级内部采用自愿组合的形式,但班级内部两个不同小组不允许选择同一题目。
4. 四、实训要求1、认真听讲。
2、遵守实训时间安排。
3、按时上机,认真练习。
4、认真书写实训报告。
时间安排表:序实习内容总天数讲课操作机动备注号1 布置题目,查找资料 1 0.3 0.72 需求分析与设计3 2 13 数据库设计及答辩 1 0.5 0.54 JSP程序设计 8 4 45 报告撰写 1 0.1 0.96 成绩评定及答辩 1 0.1 0.9合计(天数) 15 7 81. 六、成绩评定成绩包括出勤纪律、分析设计、程序编制和实训报告4个部分。
由实训指导教师科学评定成绩,各项成绩按比例累加得到实训总成绩。
实训各项占总成绩比例如下:出勤纪律:10%分析设计:20%程序编制:50%实训报告:20%注:其中平时成绩和实训报告具有一票否决权,其一不及格总成绩为不及格。
1、本实训是一门综合程序设计课程,在本实训期间,每一部分内容都是教师先讲解,让学生了解之后再进行练习。
2、本实训注重在规定的时间内完成设计内容,目的在于加强学生的动手能力。
jsp动态网站课程设计一、课程目标知识目标:1. 理解JSP技术的基本原理,掌握JSP页面的基本结构和语法。
2. 学会使用JSP内置对象,理解其作用和用途。
3. 掌握JSP与JavaBean的交互方法,能够实现数据的动态处理和展示。
4. 了解JSP在网站开发中的应用场景,能够运用所学知识构建简单的动态网站。
技能目标:1. 能够独立编写JSP页面代码,实现用户与网站的交互功能。
2. 能够运用JSP内置对象进行请求和响应的处理,实现数据的传递和展示。
3. 能够结合JavaBean完成数据的封装和业务逻辑处理,提高代码的可维护性。
4. 能够运用所学知识,设计并实现一个简单的动态网站,展示个人技术能力。
情感态度价值观目标:1. 培养学生主动探索新知识、解决问题的兴趣和热情。
2. 增强学生的团队合作意识,学会在团队中分工与协作,共同完成任务。
3. 培养学生具备良好的编程习惯,注重代码的规范性和可读性。
4. 培养学生认识到学习JSP技术对于职业发展的意义,激发其学习动力。
本课程针对高年级学生,在掌握Java基础知识的基础上,进一步学习JSP动态网站开发。
课程性质以实践为主,注重理论知识与实际操作的结合。
在教学过程中,要求学生积极参与,主动思考,通过实际操作巩固所学知识,培养实际项目开发能力。
课程目标的设定旨在使学生在掌握JSP技术的基础上,能够独立设计并实现简单的动态网站,为今后的职业发展奠定基础。
二、教学内容1. JSP技术概述:介绍JSP的概念、发展历程及在动态网站开发中的应用。
相关教材章节:第一章 JSP技术简介2. JSP基本语法:学习JSP页面的基本结构、指令、脚本和注释等。
相关教材章节:第二章 JSP基本语法3. JSP内置对象:学习request、response、session、application等内置对象的作用和使用方法。
相关教材章节:第三章 JSP内置对象4. JSP与JavaBean交互:掌握如何使用JavaBean存储数据,以及JSP与JavaBean的交互方法。
数据库课程设计报告学生选课管理系统班级:10软件本2成员:常东亚 100913010彭红明 100913028章鑫 100913050目录一、课程设计任务和目的 (2)二、需求描述 (2)三、系统总体设计 (3)1.系统架构设计 (3)2.功能模块设计 (3)3.数据库设计(概要设计) (5)(1)E-R图 (5)(2)关系模式 (5)(3)数据库管理系统 (6)(4)数据库命名 (6)(5)数据库表 (6)四、系统界面设计 (11)1、用户登录账号和密码 (11)2、窗体功能描述 (12)3、页面/窗体关系结构图 (16)五、系统实现技术小结 (16)六、课程设计体会 (19)七、系统主要源程序清单 (20)一、课程设计任务和目的完成学生选课管理系统的开发并掌握SQL数据库的建立和使用。
二、需求描述本系统是一个单机版的小型的学生选课管理系统,在本系统中,开发了一个面向管理员、学生和教师这三个对象的教务平台,对学生提供的服务有登录、选课、、修改登录密码、和查询成绩这几个服务,所选课程总数不能超过3门;对教师提供的服务有登录、修改登录密码和登录成绩;对管理员提供的服务有登录开设学生和教师帐号、删除学生和教师帐号的服务。
三、系统总体设计1.系统架构设计(1)架构:单机(2)运行软件环境: windows XP 、jdk1.6(3)开发环境:硬件平台:CPU:P41.8GHz内存:256MB以上软件平台:windows XP SP3 、jdk1.6操作系统:WindowsXP数据库:SQL Server 2000、SQLServer SP4补丁开发工具:Eclipse 3.3分辨率:1024*7682.功能模块设计各模块功能:● 登录界面:登录界面是有帐号,密码两个JTextField ,管理员帐号一字母A开头,教师帐号一字母T 开头,学生帐号以字母S 开头,登录帐号或密码输入错误会弹出相应的提示对话框。
注册-登录小实验1.0 JDK的安装 (2)2.0 Tomcat 的安装 (3)3.0 Eclipse 3.2 安装 (5)3.1 MyEclipse 的安装 (5)3.0.1 java jdk 的导入! (6)3.0.2Tomcat 的配制 (6)3.0.3 用 MyEclipse 新建一个项目 (8)3.0.5 在应程序中使用 Tomcat (8)4.0 登录——注册小实验 ! (10)4.0.1 新建一个项目 (10)4.0.2登录 (12)前台界面设计 (12)后台处理程序 (13)验证试验是否成功: (16)4.1.0 注册 (16)1.0 JDK的安装环境变量的设置set path =D:\Sun\j2sdk1.4.2_16;%paht%2.0 Tomcat 的安装设置安装路径设置用户名和密码选择你jdk 安的装的位置测试你的Tomcat 安装是否成功在IE 地址栏上输入:localhost:8080/如果不成功可以重复做一下!!3.0 Eclipse 3.2 安装Eclipse 放到你要想要放的位置就行了!!我放的是D:\Sun选择Workbeach 进入!3.1 MyEclipse 的安装MyEclipse是一个Exe安装文件,有安装向导,直接双击安装,选择完Eclipse 安装目录3.0.1 java jdk 的导入!File —> Properties —>Java Build Path3.0.2Tomcat 的配制1. Window-﹥Preference…,2. MyEclipse-﹥Application Servers-﹥Tomcat 5JDK ?3.0.3 用 MyEclipse 新建一个项目New —> Project —>MyEclipse —>Web Projecet3.0.5 在应程序中使用 Tomcat选中WebTest工程的根目录,右键菜单MyEclipse-﹥Add and Remove Projects Deployments…,在打开的对话框中确保Projects为WebTest,点击Add按钮,在弹出对话框的Server中选择Tomcat !选中项目如:点击OK!!到此 Java web开发环境配置成功!!!大家就来小试牛刀吧!4.0 登录——注册小实验 !4.0.1 新建一个项目File —> New —>Project —>MyEclipse—>Web Project添加一个Jsp 右键 webRoot : New—>JSP 名称MyJsp .jsp4.0.2登录前台界面设计代码如下:<% page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head><title>Register Test!</title></head><body> 登录界面!! <br><form method="post" action="cheklogin.jsp" name="form"><table width="183" height="85" border="1"><tr><td>User:</td><td><input type="text" name="user" size="13"></td></tr><tr><td>Password:</td><td><input type="Password" name="password" size="13" > </td></tr><tr><td><input type="Submit" name="bt1" text="OK" value="登录"> </td><td><a href="do_register.jsp" target="_parent">新用户注册<br></a></td></tr></table></form></body></html>后台处理程序添加一个Jsp 右键 webRoot : New—>JSP 名称cheklogin .jsp代码如下:<% page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><%String path = request.getContextPath();String basePath =request.getScheme()+"://"+request.getServerName()+":"+request.getServ erPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><base href="<%=basePath%>"><title>My JSP 'cheklogin.jsp' starting page</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">--></head><body><%String usr = request.getParameter("user");String pwd = request.getParameter("password");//String usr = "hurui";//String pwd = "free889";Connection con = null;Statement sm = null;ResultSet rs = null;try{Class.forName(".informix.jdbc.IfxDriver").newInstance(); //装载jdbc 驱动String url ="jdbc:informix-sqli://192.168.5.249:9003/testuser:informixserver=iser vice_online_net"; // 定义数据库连接URLcon = DriverManager.getConnection(url,"informix","informix"); //获取数据连接实例sm = con.createStatement(); //获取Statement 的实例rs = sm.executeQuery("select * from new_test_user wherelogin='"+usr+"' and password='"+pwd+"'"); //执行查询语句,并返回给结果集}catch(Exception e){e.printStackTrace( );}//添加表格%><table border="1" width="80%"><tr><td>你的用户名是:</td><td>你的密码是:</td></tr><%while (rs.next()) { //循环输出产品信息String var_name=rs.getString(1);String var_val=rs.getString(2);%><tr><%if(usr == var_name || pwd ==var_val){System.out.println("success!");}%><td><%= var_name %></td><td><%= var_val %></td></tr><%}rs.close();sm.close();con.close();%></body></html>验证试验是否成功:输入:用户名:admin密码:111114.1.0 注册数据库:iservice_online_net表:new_test_user表结构:用户名对应字段: login密码对应字段: password<%Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");String url="jdbc:odbc:Test";Connection con=DriverManager.getConnection(url,"sa"," ");if(!con.isClosed()){System.out.println("正确连接!");}else{System.out.println("连接不正确!");}con.close();%>当然也是可以不用到上面表字段就可以完成简单注册,是否使用,看你使用数据库的习惯!。
网络应用开发jsp课课程设计一、教学目标本课程的目标是让学生掌握JSP的基本概念、原理和应用方法,培养学生进行网络应用开发的能力。
知识目标:使学生了解JSP的背景、特点和基本原理,掌握JSP的基本语法和指令,熟悉JSP的内置对象和常用标签,了解JSP的运行机制和配置方法。
技能目标:培养学生能够使用JSP编写简单的Web应用程序,能够运用JSP技术进行的动态页面设计和功能实现,能够进行JSP页面的调试和优化。
情感态度价值观目标:培养学生对网络应用开发的兴趣和热情,培养学生勇于探索、积极进取的学习精神,使学生认识到JSP技术在现代社会中的重要作用和价值。
二、教学内容本课程的教学内容主要包括JSP的基本概念、原理和应用方法。
1.JSP的基本概念:介绍JSP的背景、特点和基本原理,使学生了解JSP技术的发展和应用现状。
2.JSP的基本语法和指令:讲解JSP的语法结构、指令的作用和用法,使学生能够编写简单的JSP页面。
3.JSP的内置对象和常用标签:介绍JSP的内置对象和常用标签的功能和用法,使学生能够运用JSP技术实现Web应用程序的基本功能。
4.JSP的运行机制和配置方法:讲解JSP的运行机制和配置方法,使学生能够理解和掌握JSP页面的执行过程和配置要点。
三、教学方法本课程的教学方法包括讲授法、案例分析法和实验法。
1.讲授法:通过讲解JSP的基本概念、原理和应用方法,使学生掌握JSP技术的基本知识。
2.案例分析法:通过分析典型的JSP应用程序案例,使学生了解JSP技术的实际应用,培养学生的实际操作能力。
3.实验法:通过实验操作,使学生能够动手编写JSP页面,培养学生的实际编程能力和实践能力。
四、教学资源本课程的教学资源包括教材、参考书、多媒体资料和实验设备。
1.教材:选用《JavaServer Pages》作为主要教材,系统地介绍JSP的基本概念、原理和应用方法。
2.参考书:推荐《JSP标准教程》等参考书,供学生深入学习JSP技术。
本科生毕业设计(论文)外文翻译毕业设计(论文)题目:基于JSP的高校选排课系统的设计与实现外文题目:Overview of JSP Technology译文题目:JSP技术概述学院:软件学院专业:软件工程学生姓名:学生班级:软件工程1102班学生学号:指导教师:Overview of JSP TechnologyAutor: Zambon Giulio/ Sekler MichaelSource: Springer-Verlag New York Inc1.Benefits of JSPJSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.JSP provides the following benefits over servlets alone: It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit.2. Advantages of JSP Over Competing TechnologiesA number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, ColdFusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did..So, the question becomes: why use JSP instead of one of these other technologies? Our first response is that we are not arguing that everyone should. Several of those other technologies are quite good and are reasonable options in some situations. In other situations, however, JSP is clearly better. Here are a few of the reasons.2.1Versus .NET and Active Server Pages (ASP)NET is well-designed technology from Microsoft. is the part that directly competes with servlets and JSP. The advantages of JSP are two fold.First, JSP is portable to multiple operating systems and Web servers; you aren't locked into deploying on Windows and IIS. Although the core .NET platform runs on a few non-Windows platforms, the ASP part does not. You cannot expect to deploy serious applications on multiple servers and operating systems. For some applications, this difference does not matter. Forothers, it matters greatly.Second, for some applications the choice of the underlying language matters greatly. For example, although .NET's C# language is very well designed and is similar to Java, fewer programmers are familiar with either the core C# syntax or the many auxiliary libraries. In addition, many developers still use the original version of ASP. With this version, JSP has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASP-specific language, so JSP is more powerful and better suited to complex applications that require reusable components.You could make the same argument when comparing JSP to the previous version of ColdFusion; with JSP you can use Java for the "real code" and are not tied to a particular server product. However, the current release of ColdFusion is within the context of a J2EE server, allowing developers to easily mix ColdFusion and servlet/JSP code.2.2 Versus PHPPHP (a recursive acronym for "PHP: Hypertext Preprocessor") is a free, open-source, HTML-embedded scripting language that is somewhat similar to both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is PHP.2.3 Versus Pure ServletsJSP doesn't provide any capabilities that couldn't, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.Does this mean that you can just learn JSP and forget about servlets? Absolutely not! JSPdevelopers need to know servlets for four reasons:JSP pages get translated into servlets. You can't understand how JSP works without understanding servlets.JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java code? Servlet code! You can't write that code if you don't understand servlet programming.Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.Some tasks are better accomplished by a combination of servlets and JSP than by either servlets or JSP alone.2.4 ersus JavaScriptJavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the client. So, JavaScript is not a competing technology; it is a complementary one.It is also possible to use JavaScript on the server, most notably on Sun ONE (formerly iPlanet), IIS, and BroadVision servers. However, Java is more powerful, flexible, reliable, and portable.3. Misconceptions About JSPForgetting JSP Is Server-Side Technology,Here are some typical questions Marty has received (most of them repeatedly).Our server is running JDK 1.4. So, how do I put a Swing component in a JSP page?How do I put an image into a JSP page? I do not know the proper Java I/O commands to read image files.Since Tomcat does not support JavaScript,how do I make images that are highlighted when the user moves the mouse over them?Our clients use older browsers that do not understand JSP. What should we do?When our clients use "View Source" in a browser, how can I prevent them from seeing the JSP tags?All of these questions are based upon the assumption that browsers know something about the server-side process. But they do not. Thus:For putting applets with Swing components into Web pages, what matters is the browser's Java version—the server's version is irrelevant. If the browser supports the Java 2 platform, you use the normal APPLET (or Java plug-in) tag and would do so even if you were using non-Java technology on the server.You do not need Java I/O to read image files; you just put the image in the directory for Web resources (i.e., two levels up from WEB-INF/classes) and output a normal IMG tag.You create images that change under the mouse by using client-side JavaScript, referenced with the SCRIPT tag; this does not change just because the server is using JSP.Browsers do not "support" JSP at all—they merely see the output of the JSP page. So, make sure your JSP outputs HTML compatible with the browser, just as you would do with static HTML pages.And, of course you need not do anything to prevent clients from seeing JSP tags; those tags are processed on the server and are not part of the output that is sent to the client.Confusing Translation Time with Request Time,A JSP page is converted into a servlet. The servlet is compiled, loaded into the server's memory, initialized, and executed. But which step happens when? To answer that question, remember two points: The JSP page is translated into a servlet and compiled only the first time it is accessed after having been modified.Loading into memory, initialization, and execution follow the normal rules for servlets.The most frequently misunderstood entries are highlighted. When referring to the table, note that servlets resulting from JSP pages use the _jspService method (called for both GET and POST requests), not doGet or doPost. Also, for initialization, they use the jspInit method, not the init method.JSP page translated into servlet Servlet compiled Servlet loaded into server's memory jspInit called _jspService called.JSP技术概述作者:赞邦.朱利奥/赛克勒.迈克尔出处: 施普林格出版社(纽约公司)1.JSP的好处JSP页面最终会转换成服务程序。
学生选课管理系统JavaWeb课程设计一、概述学生选课管理系统是一种用于管理学生选课信息的系统,能够实现学生注册、登录、选课、退选等功能。
本文将介绍基于JavaWeb技术设计学生选课管理系统的实现方案。
二、系统设计1. 系统结构学生选课管理系统主要包括学生管理模块、课程管理模块和选课管理模块。
2. 数据库设计系统数据库主要包括学生信息表、课程信息表、选课信息表等。
各表之间通过外键进行关联。
三、功能模块设计1. 学生管理模块•学生注册:学生可以通过系统注册账号。
•学生登录:学生可以使用注册账号登录系统。
•学生信息查看:学生可以查看个人信息。
2. 课程管理模块•课程信息查看:学生可以查看系统中所有课程信息。
•课程详情查看:学生可以查看课程的详细信息。
3. 选课管理模块•选课:学生可以选择感兴趣的课程进行选课。
•退选:学生可以退选已经选修的课程。
四、功能实现系统采用JavaWeb技术实现,包括前端页面的设计和后端逻辑的实现。
1. 前端设计系统前端页面采用HTML、CSS和JavaScript进行设计,主要包括学生登录页面、学生信息页面、课程信息页面等。
2. 后端实现系统后端采用Java语言开发,使用Servlet实现业务逻辑。
通过数据库连接池实现与数据库的交互,实现学生信息的增删改查,课程信息的查询和选课功能。
五、系统展望未来可以进一步完善系统功能,添加成绩管理模块、教师管理模块等,提升系统的全面性和实用性。
六、总结学生选课管理系统是一种重要的教务管理系统,本文设计了基于JavaWeb技术的学生选课管理系统方案,通过前后端的设计和实现,实现了学生信息管理、课程管理和选课功能。
希望该系统能够为学生选课提供便利,为教务管理提供支持。
学生在线选课系统--JSP课程设计姓名:彭仁欢学号:20140130202专业:计算机信息管理教师:吴志强2013年6月27日目录一、实验目的 (1)二、队员分析 (1)三、系统流程图 (1)四、E-R图 (2)五、程序代码(前台显示模块)与运行结果 (2)六、数据库操作 (13)七、设计心得 (21)八、设计结果 (22)一、设计目的本次实验课程设计是打算设计一个小型的学生在线选课系统,用于给学生网上在线直接选好课程然后学校能加更好的管理各们课程,本次课程设计也是基于jsp环境下进行设计的,学生运用JSP与SQL Server2000所学知识来进行开发,以此使得学生更加深刻地掌握这些语言与操作。
了解JSP对于数据库的操作,让学生能更加深刻的了解JSP的程序开发。
二、设计分析1、要求:建立一个学生选课系统2、功能:选课的增删改查,选课课程开课与截止的新闻发布的增删改查,管理员的一些后台管理等功能。
3、运行软件:Tomacat、SQL Server20004、运行环境:Windows XP系统三、系统流程图四、 E-R图五、程序代码(前台模块)与运行结果1、新闻列表代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""><%@ page contentType="text/html;charset=gb2312"%><%@ page import="java.sql.*" %><%Connection con;Statement sql;ResultSet rs;try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");}catch(Exception e){ out.print(e);}try { String uri= "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=text";String user="sa";String password="danmo0410.";con=DriverManager.getConnection(uri,user,password);sql=con.createStatement();rs=sql.executeQuery("SELECT top 10 * FROM dm_new ORDER BY dm_time");%><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="style/index.css" rel="stylesheet" type="text/css"><title>无标题文档</title></head><body><table width="850" border="0" cellpadding="0" cellspacing="0"><tr><td width="580" height="185" style="background:url(images/1_01.gif) no-repeat"></td><td width="270" height="185" style="background:url(images/1_02.gif) no-repeat"></td></tr><tr><td height="353" colspan="2" style="background:url(images/1_05.gif) no-repeat"><div id="header"><ul><li><a href="index.jsp">首页</a></li><li><a href="course.jsp">选课列表</a></li><li><a href="view.jsp">查看选课</a></li><li><a href="admin.jsp">管理中心</a></li></ul></div><div id="center"><h3>学校通知</h3><dl><% while(rs.next()){ %><dd style="background:url(images/gaoshi.gif) no-repeat center left;"><a href="index_aritle.jsp?id=<% out.print(rs.getInt("dm_id"));%>"><em><%out.print(rs.getDate("dm_time"));%></em><%out.print(rs.getString("dm_title"));%></a></dd><%}%></dl></div></td></tr><tr><td colspan="2" height="55" style="background:url(images/1_06.gif) no-repeat"> </td></tr></table></body></html><%con.close();}catch(SQLException e){ out.print(e);}%>2、查看新闻代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><%@ page contentType="text/html;charset=gb2312"%><%@ page import="java.sql.*" %><% String id=request.getParameter("id");%><% Connection con;Statement sql;ResultSet rs;try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");}catch(Exception e){ out.print(e);}try { String uri= "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=text";String user="sa";String password="danmo0410.";con=DriverManager.getConnection(uri,user,password);sql=con.createStatement();rs=sql.executeQuery("SELECT * FROM dm_new WHERE dm_id="+id+"");%><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="style/aritle.css" rel="stylesheet" type="text/css"><title>无标题文档</title></head><body><table width="850" border="0" cellpadding="0" cellspacing="0"><tr><td width="580" height="185" style="background:url(images/1_01.gif) no-repeat"></td><td width="270" height="185" style="background:url(images/1_02.gif) no-repeat"></td></tr><tr><td height="353" colspan="2" style="background:url(images/1_05.gif) no-repeat"><div id="header"><ul><li><a href="index.jsp">首页</a></li><li><a href="course.jsp">选课列表</a></li><li><a href="view.jsp">查看选课</a></li><li><a href="admin.jsp">管理中心</a></li></ul></div><div id="center"><h3>新闻查看</h3><dl><% if(rs.next()){ %><dd><strong>标题:</strong><% out.print(rs.getString("dm_title"));%> <strong>时间:</strong></strong><% out.print(rs.getDate("dm_time"));%></dd><dd><strong>内容:</strong><% out.print(rs.getString("dm_content"));%></dd><%}%><dd><a href="index.jsp"><input class="submit" type="submit" value="返回"></a></dd></dl></div></td></tr><tr><td colspan="2" height="55" style="background:url(images/1_06.gif) no-repeat"> </td></tr></table></body></html><%con.close();}catch(SQLException e){ out.print(e);}%>3、选课列表代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><%@ page contentType="text/html;charset=gb2312"%><%@ page import="java.sql.*" %><% Connection con;Statement sql;ResultSet rs;try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");}catch(Exception e){ out.print(e);}try { String uri= "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=text";String user="sa";String password="danmo0410.";con=DriverManager.getConnection(uri,user,password);sql=con.createStatement();rs=sql.executeQuery("SELECT top 10 * FROM dm_class"); %><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="style/index.css" rel="stylesheet" type="text/css"><title>无标题文档</title></head><body><table width="850" border="0" cellpadding="0" cellspacing="0"><tr><td width="580" height="185" style="background:url(images/1_01.gif) no-repeat"></td><td width="270" height="185" style="background:url(images/1_02.gif) no-repeat"></td></tr><tr><td height="353" colspan="2" style="background:url(images/1_05.gif) no-repeat"><div id="header"><ul><li><a href="index.jsp">首页</a></li><li><a href="course.jsp">选课列表</a></li><li><a href="view.jsp">查看选课</a></li><li><a href="admin.jsp">管理中心</a></li></ul></div><div id="center"><h3>在线选课</h3><dl><% while(rs.next()){%><dd style="background:url(<% out.print(rs.getString("dm_face"));%>) no-repeat center left;"><a href="course_aritle.jsp?id=<% out.print(rs.getInt("dm_id"));%>"><em><%out.print(rs.getDate("dm_time"));%></em><%out.print(rs.getString("dm_class"));%></a></dd><%}%></dl></div></td> </tr> <tr><td colspan="2" height="55" style="background:url(images/1_06.gif) no-repeat"> </td></tr></table></body></html><%con.close();}catch(SQLException e){ out.print(e);}%>4、进行选课代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><%@ page contentType="text/html;charset=gb2312"%><%@ page import="java.sql.*" %><% String id=request.getParameter("id");%><% Connection con;Statement sql;ResultSet rs;try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");}catch(Exception e){ out.print(e);}try { String uri= "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=text";String user="sa";String password="danmo0410.";con=DriverManager.getConnection(uri,user,password);sql=con.createStatement();rs=sql.executeQuery("SELECT * FROM dm_class WHERE dm_id="+id+"");%><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="style/aritle.css" rel="stylesheet" type="text/css"><title>无标题文档</title></head><body><table width="850" border="0" cellpadding="0" cellspacing="0"><tr><td width="580" height="185" style="background:url(images/1_01.gif) no-repeat"></td><td width="270" height="185" style="background:url(images/1_02.gif) no-repeat"></td></tr><tr><td height="353" colspan="2" style="background:url(images/1_05.gif) no-repeat"><div id="header"><ul><li><a href="index.jsp">首页</a></li><li><a href="course.jsp">选课列表</a></li><li><a href="view.jsp">查看选课</a></li><li><a href="admin.jsp">管理中心</a></li></ul></div><div id="center"><h3>新闻查看</h3><dl><% if(rs.next()){ %><dd><strong>标题:</strong><% out.print(rs.getString("dm_class"));%> <strong>时间:</strong></strong><% out.print(rs.getDate("dm_time"));%> <strong>已报人数:</strong></strong><% out.print(rs.getInt("dm_renshu"));%></dd><dd><strong>内容:</strong><%out.print(rs.getString("dm_content"));%></dd><%}%><dd><a href="course.jsp"><input class="submit" type="submit" value="返回"></a></dd></dl><h3>写入信息</h3><dl class="write"><form action="course_ceshi.jsp" method="post"><input type="hidden" name="renshu" value="<% out.print(rs.getString("dm_renshu"));%>" /><input type="hidden" name="kehao" value="<% out.print(rs.getString("dm_id"));%>" /><input type="hidden" name="kecheng" value="<% out.print(rs.getString("dm_class"));%>" /><dd>学号:<input type="text" name="xuehao" />(*学号只能为数字*)</dd><dd>姓名:<input type="text" name="username" />(*输入你的姓名*)</dd><dd>性别:<input type="radio" name="sex" value="男" checked="checked"/>男<input type="radio" name="sex" value="女"/>女</dd><dd>专业:<input type="text" name="classes" />(*输入你的专业*)</dd><dd><input class="name" type="submit" value="提交" /></dd> </form></dl></div></td></tr><tr><td colspan="2" height="55" style="background:url(images/1_06.gif) no-repeat"> </td></tr></table></body></html><%con.close();}catch(SQLException e){ out.print(e);}%>5、查询选课代码<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><%@ page contentType="text/html;charset=gb2312"%><%@ page import="java.sql.*" %><%Connection con;Statement sql;ResultSet rs;try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");}catch(Exception e){ out.print(e);}try { String uri= "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=text";String user="sa";String password="danmo0410.";con=DriverManager.getConnection(uri,user,password);sql=con.createStatement();rs=sql.executeQuery("SELECT top 8 * FROM dm_class ORDER BY dm_time ");%><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="style/view.css" rel="stylesheet" type="text/css"><title>无标题文档</title></head><body><table width="850" border="0" cellpadding="0" cellspacing="0"><tr><td width="580" height="185" style="background:url(images/1_01.gif) no-repeat"></td><td width="270" height="185" style="background:url(images/1_02.gif) no-repeat"></td></tr><tr><td height="353" colspan="2" style="background:url(images/1_05.gif) no-repeat"><div id="header"><ul><li><a href="index.jsp">首页</a></li><li><a href="course.jsp">选课列表</a></li><li><a href="view.jsp">查看选课</a></li><li><a href="admin.jsp">管理中心</a></li></ul></div><div id="center"><h3>查询选课</h3><dl><form action="view_aritle.jsp" method="post"><dd class="cha">输入学号:<input name="name" type="text"/><input type="submit" value="查询"/></dd></form><form action="view_aritle_a.jsp" method="post"><dd class="cha">输入课程:<input name="classname" type="text"/><input type="submit" value="查询"/></dd></form></dl><h3 style="clear:both;">课程详细</h3><dl><% while(rs.next()){ %><dd class="xi" style="background:url(images/gaoshi.gif) no-repeat center left;"><a href="view_aritle_b.jsp?id=<% out.print(rs.getInt("dm_id"));%>"><em><%out.print(rs.getDate("dm_time"));%></em><%out.print(rs.getString("dm_class"));%></a></dd><%}%></dl></div></td></tr><tr><td colspan="2" height="55" style="background:url(images/1_06.gif) no-repeat"> </td></tr></table></body></html><%con.close();}catch(SQLException e){ out.print(e);}%>六、数据库操作建立3张表:1.dm_class:课程表2.dm_new:新闻表3.dm_student:学生选课表七、设计结果本次课程设计—-学生在线选课系统,运用JSP命令以及数据库连接操作,使得程序运行成功。