软件工程专业“大型软件项目实训”报告模板DOC.doc_第1页
软件工程专业“大型软件项目实训”报告模板DOC.doc_第2页
软件工程专业“大型软件项目实训”报告模板DOC.doc_第3页
软件工程专业“大型软件项目实训”报告模板DOC.doc_第4页
软件工程专业“大型软件项目实训”报告模板DOC.doc_第5页
已阅读5页,还剩40页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

精品文档大型软件项目实训报告教学单位 软件学院 专 业 软件工程 班 级 学生姓名 学 号 指导教师 一、实训目的1、增强自己的专业水平2、积累大型项目的开发经验3、学习不同的面试技巧4、培养职场道德及行为规范5、通过培训寻找一份适合自己的工作二、实训时间和地点1实训时间:2013年11月29月2014年3月29日2实训地点:达内(沈阳)盛京中心三、实训单位简介达内,全称达内时代科技集团有限公司,是中国高端IT培训的领先品牌,致力于培养面向电信何金融领域的java、c+、c#/.Net、软件测试、嵌入式、PHP、android等方面的中高端软件人才,由美国国际数据集团、集富亚洲和高盛集团共同投资,是国内首家获得国际风险投资的IT培训机构。经过10多年的运营,达内科技实现了90%的专业就业率,78%的口碑就业率,学员毕业首月平均工资3800元。2002年起,达内软件技术有限公司已经发展成为集培训、咨询、开发、人才服务于一体的高新科技集团公司达内时代科技集团有限公司以中关村科技园区为依托,在中国软件发达城市北京、上海、珠海、重庆、广州、深圳、哈尔滨、南京武汉、杭州、西安、苏州、沈阳、大连等城市建立了近100家培训中心,年培训1.2万多名软件人才,累计为IBM、微软、华为、中软、用友、阿里巴巴、新浪、搜狐、百度、联想、大唐电信、亚信等知名IT企业输送了12万多名中高级软件人才,全国拥有3000多名员工,合作企业达3万多家,是中国领先的中高端软件人才培训机构四、实训内容1实训期间完成的学习任务本次实训中主要学习了java基础,javase,javaee,oracle,jdbc,html/css/js、jsp、servlet等目前正在使用且流行的编程技术。实训是通过远程视频教学进行的。讲师首先讲解一些基础知识,随后通过项目实战的方式,教授我们如何运用这些知识,如何编写一个好的程序。在整个实训过程中我们先后完成了俄罗斯方块,坦克大战、即时聊天、数据库连接、员工信息管理等实际项目,在开发中,了解了程序开发的具体过程,及基础知识在实际中如何应用。每当遇到程序出现异常,项目经理组织我们集体讨论并寻找问题所在,培养了我们的团队合作能力。在每个月的月末,我们还会进行模拟企业面试中的笔试,通过笔试发现自己的缺陷及不足。2实训期间完成的实践项目在长达3个多月的培训中,我们完成了多个项目,其中包括使用java基础语言及javaAWT控件编写的俄罗斯方块,使用socket编程完成的简化即时聊天系统,以及使用java企业级开发思想及MVC结构思想编写的员工表管理系统等等。因为很多技术目前已经过时,在未来程序开发中不会被继续使用,所以在本报告中将详细介绍员工管理系统。2.1 需求分析1、用户打开网页之后将显示目前已有员工的各项信息2、用户可以进行添加员工操作,添加员工后需要直接显示新的员工信息表3、用户可以进行员工删除操作,但是在修改之前需要进行确认4、用户可以进行员工信息修改操作2.2 总体设计1、在数据库中新建员工信息表2、使用PhotoShop及css技术设计网页显示的样式3、编写后台控制java程序,用于连接数据库和控制前端操作4、编写jsp页面用于显示在用户不同的操作下,应该显示的页面5、项目调试2.3 详细设计1:新建员工信息表因为在本项目中使用的数据库为mysql数据库,所以在创建数据表时应注意变量类型与oracla数据库的区别。另外必须处理数据库中出现的中文问题建立员工信息表create database servletemp default character set utf8;(这段代码用于设置数据库的字符集,字符集为utf-8,该字符集支持中文,如果不设置字符集数据库会默认采用ISO-8859-1字符集,但是该字符集不支持中文)create table emp_a(id int (10)primary key auto_increment,name varchar(20),salary double,age int );其中id为主键,且设置为自动增长,所以在执行插入操作时不用设置id的值,这样便于程序运行及员工表管理为了便于程序调试,先向表中添加几条数据Insert into emp_a(name,salary,age) value(emp01,20000,20);Insert into emp_a(name,salary,age) value(emp02,20000,21);Insert into emp_a(name,salary,age) value(emp03,20000,22);Insert into emp_a(name,salary,age) value(emp04,20000,23);2:设计页面显示样式即美工操作网页显示样式1:css编写body margin: 0;font-size: 62.5%;font-family: Verdana, Arial, Helvetica, sans-serif;padding: 15px 0;background: #eeeeee;#wrap width: 820px;margin: 0 auto;background: url(./img/bg.gif) top center repeat-y #FFFFFF;#top_content padding: 0 10px;#topheader padding: 25px 15px 15px 15px;margin: 0 auto 0 auto;background: url(./img/top_left.gif) top left repeat-x #85C329;#rightheader float: right;width: 375px;height: 40px;color: #FFFFFF;text-align: right;#rightheader p padding: 35px 15px 0 0;margin: 0;text-align: right;#rightheader p span font-weight: bold;#rightheader a:link, #rightheader a:visited color: #FFFFFF;text-decoration: underline;#title padding: 0;margin: 0;font-size: 2.5em;color: #FFFFFF;#title span font-size: 0.5em;font-style: italic;#title a:link, #title a:visited color: #FFFFFF;text-decoration: none;#title a:hover color: #E1F3C7;#navigation background: #74A8F5;border-top: 1px solid #ffffff;height: 25px;clear: both#navigation ul padding: 0;margin: 0;list-style: none;font-size: 1.1em;height: 25px;#navigation ul li display: inline;#navigation ul li a color: #FFFFFF;display: block;text-decoration: none;float: left;line-height: 25px;padding: 0 16px;border-right: 1px solid #ffffff;#navigation ul li a:hover background: #5494F3;#content padding: 0 15px;margin: 0 auto 0 auto;background: url(./img/content_bg.gif) repeat-x left top #ffffff;color: #666666;#content p#whereami padding: 20px 0 15px 0;margin: 0;#whereami a:link, #whereami a:visited color: #73A822;text-decoration: underline;#content h1, #content h2, #content h3, #content h4 , #content h5 color: #74A8F5;#content h1 font-family: Trebuchet MS, Arial, Helvetica;padding: 0;margin: 0 0 15px 0;font-size: 2em;#content h2 font-family: Trebuchet MS, Arial, Helvetica;padding: 0;margin: 0 0 15px 0;font-size: 1.5em;#top_body, #content_body padding: 0 25px;#footer background: url(./img/footer.gif) no-repeat center bottom ;color: #FFFFFF;padding: 0 10px 13px 10px;#footer p padding: 0;margin: 0;#footer p a:link, #footer p a:visited color: #FFFFFF;font-style: italic;text-decoration: none;#footer #footer_bg background: url(./img/footer_bg.gif) repeat-x left bottom #85C329;padding: 15px 15px 25px 15px;border-top: 1px solid #7BB425;#footer #design display: block; width: 150px; height: 30px;float: right;line-height: 20px;padding: 0 5px;text-align: right;color: #E1F3C7;#footer #design a color: #FFFFFF;text-decoration: underline;.table margin-bottom: 15px;width: 100%;border-collapse: collapse;.table_header td background: url(./img/tableheader-bg.gif) no-repeat left top;padding: 5px 10px;color: rgb(70,122,167);border-top: 1px solid #CBD6DE;border-bottom: 1px solid #ADBECB;font-size: 1.1em;font-weight: bold;.table_header td a:link, .table_header td a:visited text-decoration: underline;color: rgb(70,122,167);.table_header td a:hover text-decoration: underline;color: #73A822;.table_header td border: 1px solid #CBD6DE;.row1 td, .row2 td, .row_hover td, .paging_row td padding: 5px 10px;color: #666666;border: 1px solid #CBD6DE;.row1 td background: #ffffff;.row2 td background: #eeeeee;.row_hover td background: #FBFACE;color: #000000;.hidden display: none;.little font-size: 10px;.clear clear: both;.img_left float: left;padding: 1px;border: 1px solid #cccccc;margin: 0 10px 10px 0;width: 110px;height:150px;/* #content ul basic style for unordered lists-*/#content ul font-size: 1.1em;line-height: 1.8em;margin: 0 0 15px 0;padding: 0;list-style-type: none;/* #content p paragraphs-*/#content p font-size: 1.2em;margin: 0;padding: 0 0 15px 0;/* #content p a links in paragraphs-*/#content p a:link, #content p a:visited, .table a:link, .table a:visited,.link a color: #73A822;text-decoration: none;#content p a:hover, .table a:hover, .link a:hover text-decoration: underline;/* #content ul.green (73A822)-*/#content ul.green li padding: 0 0 0 20px;margin: 0;background: url(./img/bullet_green.gif) no-repeat 1px 3px;font-size: 1.1em;#content ul.green li a:link, #content ul.green li a:visited color: #73A822;text-decoration: none;#content ul.green li a:hover color: #73A822;text-decoration: underline;/* #content ul.black (73A822)-*/#content ul.black li padding: 0 0 0 20px;margin: 0;background: url(./img/bullet_grey.gif) no-repeat 1px 3px;font-size: 1.1em;#content ul.black li a:link, #content ul.black li a:visited color: #666666;text-decoration: none;#content ul.black li a:hover color: #999999;text-decoration: underline;/* #content ol-*/#content ol padding: 0 0 0 25px;margin: 0 0 15px 0;line-height: 1.8em;#content ol li font-size: 1.1em;#content ol li a:link, #content ol li a:visited color: #73A822;text-decoration: none;#content ol li a:hover color: #73A822;text-decoration: underline;/* #content p.paging -*/#content p.paging padding: 5px;border: 1px solid #CBD6DE;text-align: center;margin-bottom: 15px;background: #eeeeee;/* .small_input smaller text in inputs/combos-*/.small_input font-size: 10px;/* .form_table style for table used in forms-*/.form_table margin-bottom: 15px;font-size: 1.1em;.form_table p margin: 0;padding: 0;.form_table td padding: 5px 10px;/* .checkbox_nomargins clear all margins from a checkbox-*/.checkbox_nomargins /*margin:0;width:13px;height:13px;overflow:hidden;font-size: 10px;*/margin: 0;padding: 0;/* .button some buttons style - inspired from wordpress-*/input.button margin: 0;padding: 2px;border: 3px double #999999;border-left-color: #ccc;border-top-color: #ccc;background: url(./img/button.gif) repeat-x left top;font-size: 11px;font-family: Verdana, Arial, Helvetica, sans-serif;/* form style for forms-*/form padding: 0;margin: 0;/* input.inputgri - some style for inputs-*/input.inputgri, select.inputgri, textarea.inputgri background: #eeeeee;font-size: 14px;border: 1px solid #cccccc;padding: 3px;input.inputgri:focus, select.inputgri:focus , textarea.inputgri:focus background: #ffffff;border: 1px solid #686868;/* .notice - messages to user-*/.notice background: #CAEA99; border: 1px solid #70A522; padding: 15px 15px 15px 15px; margin-bottom: 15px;font-size: 1.2em;color: #333333;.notice_error background: #FEDCDA; border: 1px solid #CE090E; padding: 15px 15px 15px 15px; margin-bottom: 15px;font-size: 1.2em;color: #333333;#notice a color: #333333;text-decoration: underline;/* Other links -*/.other_links background: #eeeeee;border-top: 1px solid #cccccc;padding: 5px;margin: 0 0 15px 0;#content .other_links h2 color: #999999;padding: 0 0 0 3px;margin: 0;#content .other_links ul padding: 0;margin: 0;#content .other_links ul li padding: 0 0 0 20px;background: url(./img/bullet_grey.gif) no-repeat left center;#content .other_links a, #content .other_links a:visited color: #999999;text-decoration: underline;#content .other_links a:hover color: #666666;/* code */code font-size: 1.2em;color: #73A822;网页显示样式2:最终网页样式(图片)图 1图 2因为css样式设计属于美工的任务,这里不做过多解释及叙述3:设计静态网页及编写后台java控制程序作为整个web项目的核心,java后台控制程序负责连接数据库,针对用户的操作对员工表进行增删改操作,控制前端页面跳转。这里使用网络应用程序架构中的三层c/s,三层c/s结构开发效率很高,可移植性好,适合大型企业级开发,是目前非常流行的开发模式。三层c/s结构特点是:应用服务器负责所有的业务运算,客户端只提供操作界面,数据库负责所有数据的管理3.1 创建util包,并在util包下创建DBUtil类该类负责提供连接数据库的方法,及关闭数据库链接的方法,以下是具体程序内容:(注意以下为静态方法,也就是不需要创建对象直接使用类名就可以直接调用)package util;import java.sql.Connection;import java.sql.DriverManager;import java.sql.SQLException;public class DBUtil public static Connection getConnection() throws ExceptionConnection conn = null;try Class.forName(com.mysql.jdbc.Driver);conn = DriverManager.getConnection(jdbc:mysql:/localhost:3306/jsd1310db +?useUnicode=true&characterEncoding=utf8,root,1234); catch (Exception e) e.printStackTrace();throw e;return conn;public static void close(Connection conn)if(conn != null)try conn.close(); catch (SQLException e) public static void main(String args) throws Exception System.out.println(getConnection();3.2创建entity包,并在该包下创建Employee实体类为了开发方便Employee实体类严格参照emp_a表创建,变量名及变量类型要与表中的字段名及字段类型保持一致,并将实例变量私有化。在实体类中添加get()和set()方法,用来获取和设置变量值,并重写toString()方法package entity;public class Employee private int id;private String name;private double salary;private int age;public String toString() return name + + salary + + age;public int getAge() return age;public void setAge(int age) this.age = age;public int getId() return id;public void setId(int id) this.id = id;public String getName() return name;public void setName(String name) = name;public double getSalary() return salary;public void setSalary(double salary) this.salary = salary;3.3创建dao包并在包中创建EmployeeDAO类该类负责封装针对数据表的增删改操作package dao;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.util.ArrayList;import java.util.List;import util.DBUtil;import entity.Employee;public class EmployeeDAO public void update(Employee e) throws ExceptionConnection conn = null;PreparedStatement prep = null;try conn = DBUtil.getConnection();prep = conn.prepareStatement(update t_emp set name=?,salary=?,age=? +where id=?);prep.setString(1, e.getName();prep.setDouble(2, e.getSalary();prep.setInt(3, e.getAge();prep.setInt(4, e.getId();prep.executeUpdate(); catch (Exception e1) e1.printStackTrace();throw e1;finallyDBUtil.close(conn);public Employee findById(int id) throws ExceptionEmployee e = null;Connection conn = null;PreparedStatement stat = null;ResultSet rst = null;try conn = DBUtil.getConnection();stat = conn.prepareStatement(select * from t_emp where id=?);stat.setInt(1, id);rst = stat.executeQuery();if(rst.next()String name = rst.getString(name);double salary = rst.getDouble(salary);int age = rst.getInt(age);e = new Employee();e.setId(id);e.setName(name);e.setSalary(salary);e.setAge(age); catch (Exception e1) e1.printStackTrace();throw e1;finallyDBUtil.close(conn);return e;public void delete(int id) throws ExceptionConnection conn = null;PreparedStatement prep = null;try conn = DBUtil.getConnection();prep = conn.prepareStatement(delete from t_emp where id=?);prep.setInt(1, id);prep.executeUpdate(); catch (Exception e) e.printStackTrace();throw e;finallyDBUtil.close(conn);public void save(Employee e) throws ExceptionConnection conn = null;PreparedStatement prep = null;try conn = DBUtil.getConnection();prep = conn.prepareStatement(insert into t_emp(name,salary,age) +values(?,?,?);prep.setString(1, e.getName();prep.setDouble(2, e.getSalary();prep.setInt(3, e.getAge();prep.executeUpdate(); catch (Exception e1) e1.printStackTrace();throw e1;finallyDBUtil.close(conn);public List findAll() throws ExceptionList employees = new ArrayList();Connection conn = null;PreparedStatement stat = null;ResultSet rst = null;try conn = DBUtil.getConnection();stat = conn.prepareStatement(select * from t_emp);rst = stat.executeQuery();while(rst.next()int id = rst.getInt(id);String name = rst.getString(name);double salary = rst.getDouble(salary);int age = rst.getInt(age);Employee e = new Employee();e.setId(id);e.setName(name);e.setSalary(salary);e.setAge(age);employees.add(e); catch (Exception e) e.printStackTrace();throw e;finallyDBUtil.close(conn);return employees;3.4 创建web包,并在该包下创建ActionServlet类该类负责用户的前端操作,根据用户发送的不同请求调用相应的方法对数据库进行相应打的增删改操作,并根据请求的url跳转等到不同的jsp页面。特别需要注意的是应该针对程序中出现的异常进行捕获,并且需要有相应的输出核心实现过程:1、 绑定数据到request对象上:request.setAttribute(String name,Object obj);2、获得转发器:RequestDispatcher rd = request.getRequestDispatcher(String url);3、转发:rd.forward(request,response);转发的特点:转发之后浏览器地址栏的地址不变转发的地址必须是同一个应用内部的地址具体程序:package web;import java.io.IOException;import java.io.PrintWriter;import java.util.List;import javax.servlet.RequestDispatcher;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import dao.EmployeeDAO;import entity.Employee;public class ActionServlet extends HttpServlet public void service(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException request.setCharacterEncoding(utf-8);response.setContentType(text/html;charset=utf-8);PrintWriter out = response.getWriter();String uri = request.getRequestURI();String action = uri.substring(uri.lastIndexOf(/),uri.lastIndexOf(.);if(action.equals(/list)EmployeeDAO dao = new EmployeeDAO();try List employees = dao.findAll();/使用转发request.setAttribute(employees, employees);RequestDispatcher rd = request.getRequestDispatcher(empList2.jsp);rd.forward(request, respo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论