《JAVA应用开发课程设计》课程设计客户信息管理系统_第1页
《JAVA应用开发课程设计》课程设计客户信息管理系统_第2页
《JAVA应用开发课程设计》课程设计客户信息管理系统_第3页
《JAVA应用开发课程设计》课程设计客户信息管理系统_第4页
《JAVA应用开发课程设计》课程设计客户信息管理系统_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

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

文档简介

1、java应用开发课程设计课程设计课 程 设 计 说 明 书系 部: 计算机技术系 专 业: 软件技术(niit) 课题名称: java应用开发课程设计课程设计 班 级:学 号:姓 名:指导教师: 无锡职业技术学院电子与信息工程学院计算机技术系软件教研室 2011 年 12 月 7 日目 录java应用开发课程设计课程设计任务书2课程设计说明书3课程设计小结22java应用开发课程设计课程设计任务书系部 班级 学号 姓名 本课程设计的目的是通过java应用程序开发课程设计,使学生掌握基于mvc模式的java ee开发理念、掌握以数据库为后台的应用程序开发,使学生初步具备使用jsp、java se

2、rvlet、struts框架结构进行b/s应用程序开发的能力。课程设计特别强调与企业软件开发过程的接轨,强调企业开发中的编程规范,采用软件开发的流程,使学生在课程设计中熟悉企业软件开发的过程。按照java应用程序开发课程设计实训指导书的要求,本课程设计要求学生完成下述几个项目:1. 学生信息管理系统项目该项目以学生基本信息管理为基础,构建基于b/s架构的学生信息管理平台,为用户和数字化校园提供数据服务,保证了数据的一致性、权威性、准确性和及时性。通过本项目,学生可以熟练掌握相关开发工具的基本使用方法,理解html、jsp、javascript的基本原理,学会在相关文档的指导下完成项目的设计、编

3、码、实现。2. 客户信息管理系统项目该项目使用计算机技术实现客户管理系统,能够满足现代企业对自身客户资源管理的要求,同时可以减少客户资源管理过程中的大量人力、物力和财力等。通过本项目,学生掌握使用struts mvc框架设计web应用程序,开发struts动作类、配置struts动作映射,理解在web应用程序中会话管理的基本原理,学会数据库建模并实现web应用程序与数据库的集成,使用struts标签库编写jsp代码,开发actionform类、配置视图表单,在教师的指导下完成整个项目的设计、编码、实现。3. niit mvc4-mt1(j2ee)和mvc4-mt2(j2me)知识整理与测试该项

4、目侧重niit mvc4-mt1(j2ee)和niit mvc4-mt2(j2me)知识点整理、课堂测试、真题讲解。促使学生理解并掌握使用java开发移动应用程序、使用servlet和jsp技术开发web组件的相关理论基础知识。开始日期: 2011 年 11 月 24 日 完成日期: 2011 年 12 月 7 日答辩日期: 2011 年 12 月 7 日 指导老师: 邱晓荣 黄能耿 课程设计说明书一、 项目名称客户信息管理系统二、 需求分析 随着科技的发展、时代的进步,市场经济的竞争也越发激烈,在竞争中客户作为市场最主要的资源,早已成为市场营销的核心。企业拥有越多的客户资源,其在市场竞争中就

5、会占有相当大的优势。 随着企业的壮大,客户也越来越多,客户管理就越发显得重要。传统的手工操作管理方式,易发生数据丢失、统计错误、劳动强度高、速度慢等问题。 使用计算机技术实现客户管理系统能够满足现代企业对自身客户资源管理的要求,同时可以减少客户资源管理过程中的大量人力、物力和财力等。下图是系统结构的功能模块图: 客户信息管理系统用户登录客户信息管理添加客户信息更改客户信息显示客户信息删除客户信息 图1 功能模块图三、 系统设计1. 系统平台搭建l 操作系统:windows xpl 体系结构:基于b/s模式的java ee应用程序l 数据库系统:microsoft sql server 2005

6、l 第三方框架:struts 1.3.xl 应用服务器:tomcat 7.xl 集成开发环境:eclipse 3.7.x(indigo)2. 数据库建模l 利用powerdesigner进行数据库建模l 新建microsoft sql server 2005数据库l 数据库名为:customerinfomisl 利用sql脚本初始化数据库l 配置microsoft sql server 2005数据库1 配置tcp端口:开始-程序-microsoft sql server 2005-配置工具-sql server configuration manager-sql server 2005网络配

7、置-mssqlserver协议,启用tcp/ip。 2 在sql server configuration manager-sql server 2005 网络配置-mssqlserver协议中双击tcp/ip,在ip 地址标签页中将所有tcp 端口项设置默认的1433端口。 3 sql server configuration manager-sql server 2005服务中重新启动sql server(mssqlserver),这样就完成了对sql2005服务器的配置。 3、利用powerdesigner进行数据库建模l 数据库名称:customerinfomisl 数据库类型:mic

8、rosoft sql server 2005l 相关数据表u 用户信息表:userinfou 客户信息表:customerinfo1 新建microsoft sql server 2005数据库,数据库名为:customerinfomis表1 用户信息表userinfo字段名称字段含义字段类型是否允许为空主外键约束自动增长userid用户idint不能为空主键是username用户名称nvarchar(50)不能为空userpassword用户密码nvarchar(50)不能为空 表2 客户信息表customerinfo字段名称字段含义字段类型是否允许为空主外键约束自动增长customerid

9、客户idint不能为空主键是customername客户名称nvarchar(50)不能为空enterprisecharacter企业性质nvarchar(50)不能为空customerrank客户级别nvarchar(50)不能为空customertype客户类型nvarchar(50)不能为空customeraddress客户地址nvarchar(50)不能为空customermailcode客户邮编nvarchar(50)不能为空enterprisecharger法人代表nvarchar(50)不能为空bankaccount银行账号nvarchar(50)不能为空taxaccount纳税

10、账号nvarchar(50)不能为空customerwebsite客户网址nvarchar(50)不能为空customertelephone联系电话nvarchar(50)不能为空customerfax联系传真nvarchar(50)不能为空2.下图是表关系图:该图显示了表的字段名以及类型和表之间的关系。 图2 表关系图3配置microsoft sql server 2005数据库l 配置tcp端口:开始-程序-microsoft sql server 2005-配置工具-sql server configuration manager-sql server 2005网络配置-mssqlser

11、ver协议,启用tcp/ip。 l 在sql server configuration manager-sql server 2005 网络配置-mssqlserver协议中双击tcp/ip,在ip 地址标签页中将所有tcp 端口项设置默认的1433端口。 l sql server configuration manager-sql server 2005服务中重新启动sql server(mssqlserver),这样就完成了对sql2005服务器的配置。 四、 详细设计1. 新建项目customerinfomis新建dynamic web project;项目名称为:customerinf

12、omis,注意存放项目的路径2. 新建web.xml在webcontent/web-inf目录下新建web.xml3. jstl的安装与配置将jstl.jar 、standard.jar 两个文件复制到项目/webcontent/web-inf/lib 目录下,并添加项目对以上两个jar 包的应用4. struts的安装与配置在官网上下载struts-1.3.10-lib.zip,然后解压;将解压后的lib子文件夹下的所有内容复制到项目/webcontent/web-inf/lib文件夹下即可添加对相关包的引用,最后在/webcontent/web-inf目录下新建struts-config.

13、xml,对相关动作类进行配置,同时需要在web.xml配置基础结构控制器5. jdbc驱动的安装与配置 将sql server 2005 的jdbc 驱动sqljdbc4.jar 复制到项目/webcontent/web-inf/lib 目录下,并添加项目对该jar 包的引用6. 构建model层com.wxit.bean在src目录下新建包com.wxit.bean,在其新建customerinfo3030098131类7. 构建view层com.wxit.form在src目录下新建包com.wxit.form,在其下新建customerinfoform3030098131类8. 构建con

14、troller层com.wxit.action在src目录下新建包com.wxit.action9. 构建资源层com.wxit.util在src目录下新建包com.wxit.util,新建数据库配置文件dbconnection和字符过滤器charactarencodingfilter10. 新建/webcontent/mainweb子目录在/webcontent目录下新建customerinfo子目录用于存放customerinfo表相关的view层jsp文件11. customerinfo list模块的设计与实现l 在/webcontent/customerinfo子目录下新建custo

15、merinfolist3030098131.jspl 在com.wxit.action中新建customerinfolistaction3030098131l 在struts-config.xml中配置相关动作类l 部署与测试12. customerinfo add模块的设计与实现l 在/webcontent/customerinfo目录中新建customerinfoadd3030098131.jspl 在com.wxit.action中新建customerinfoaddaction3030098131l 在struts-config.xml中配置相关动作类l 部署与测试13. custome

16、rinfo modify、update模块的设计与实现l 在/webcontent/customerinfo目录中新建customerinfomodify3030098131.jspl 在com.wxit.action中新建customerinfomodifyaction3030098131和customerinfoupdateaction3030098131l 在struts-config.xml中配置相关动作类l 部署与测试14. customerinfo delete模块的设计与实现l 在com.wxit.action中新建customerinfodeleteaction30300981

17、31l 在struts-config.xml中配置相关动作类l 部署与测试15. customerinfo detail模块的设计与实现l 在/webcontent/customerinfo目录中新建customerinfodetail3030098131.jspl 在com.wxit.action中新建customerinfodetailaction3030098131l 在struts-config.xml中配置相关动作类l 部署与测试五、 实施过程1 在src目录下新建包com.wxit.bean,新建com.wxit.bean.customerinfo3030098131 关键代码如下

18、: public class customerinfo3030098131 private int icustomerid3030098131;private string scustomername3030098131;private string senterprisecharacter3030098131;private string scustomerrank3030098131;private string scustomertype3030098131;private string scustomeraddress3030098131;private string scustome

19、rmailcode3030098131;private string senterprisecharger3030098131;private string sbankaccount3030098131;private string staxaccount3030098131;private string scustomerwebsite3030098131;private string scustomertelephone3030098131;private string scustomerfax3030098131;public int geticustomerid3030098131()

20、 return icustomerid3030098131;public void seticustomerid3030098131(int icustomerid3030098131) this.icustomerid3030098131 = icustomerid3030098131;2在src目录下新建包com.wxit.form,在该包下新建customerinfoform3030098131类,关键代码如下:public class customerinfoform3030098131 extends actionformprivate int icustomerid30300981

21、31;private string scustomername3030098131;private string senterprisecharacter3030098131;private string scustomerrank3030098131;private string scustomertype3030098131;private string scustomeraddress3030098131;private string scustomermailcode3030098131;private string senterprisecharger3030098131;priva

22、te string sbankaccount3030098131;private string staxaccount3030098131;private string scustomerwebsite3030098131;private string scustomertelephone3030098131;private string scustomerfax3030098131;public int geticustomerid3030098131() return icustomerid3030098131;public void seticustomerid3030098131(in

23、t icustomerid3030098131) this.icustomerid3030098131 = icustomerid3030098131;public string getscustomername3030098131() return scustomername3030098131;3. 在src目录下新建包com.wxit.util,新建数据库配置文件dbconnection和字符过滤器(1)数据库配置文件dbconnection,关键代码如下所示: package com.wxit.util;import java.sql.connection;import java.sq

24、l.drivermanager;import java.sql.sqlexception;public class dbconnection public static connection getconnection() throws sqlexception connection conn;try class.forname(com.microsoft.sqlserver.jdbc.sqlserverdriver);conn = drivermanager.getconnection(jdbc:sqlserver:/localhost;databasename=customerinfomi

25、s;+ user=sa;password=sa); catch (exception e) conn = null;return conn;(2)字符过滤器charactarencodingfilter,关键代码如下:public class charactarencodingfilter implements filter public void destroy() public void dofilter(servletrequest request, servletresponse response,filterchain chain) throws ioexception, servl

26、etexception request.setcharacterencoding(utf-8);chain.dofilter(request, response);overridepublic void init(filterconfig arg0) throws servletexception / todo auto-generated method stub4. 在web.xml文件中添加过滤器注册信息,关键代码如下所示: charactarfileter com.wxit.util.charactarencodingfilter charactarfileter /* 5.在web.x

27、ml文件中配置struts基础结构控制器,关键代码如下所示: frontcontroller org.apache.struts.action.actionservlet config /web-inf/struts-config.xml 1 frontcontroller *.do 6.在/webcontent/customerinfo目录新建customerinfolist3030098131.jsp,关键代码如下所示:function warn(value)return confirm(真的要删除吗?);客户信息列表客户名称企业性质 客户级别 查看更新删除/方法相同,在此省略其它字段ah

28、ref=/customerinfomis/customerinfo/customerinfodetail.do?icustomerid3030098131=查看ahref=/customerinfomis/customerinfo/customerinfomodify.do?icustomerid3030098131=更新ahref=/customerinfomis/customerinfo/customerinfodelete.do?icustomerid3030098131= onclick=return warn()删除ahref=/customerinfomis/referencein

29、fo/referenceinfolist.do?icustomerid3030098131=查看联系人信息 7.在com.wxit.action中新建customerinfolistaction3030098131类,关键代码如下: connection conn = null;string target = failure;list customerinfolist = new arraylist();try conn = dbconnection.getconnection(); statement stmt = conn.createstatement(); string qu

30、ery = select * from customerinfo; resultset rs = stmt.executequery(query); while (rs.next() customerinfoform3030098131 customerinfoform = new customerinfoform3030098131();customerinfoform.seticustomerid3030098131(rs.getint(1);customerinfoform.setscustomername3030098131(rs.getstring(2);customerinfofo

31、rm.setsenterprisecharacter3030098131(rs.getstring(3);/方法相同,在此省略其它字段customerinfolist.add(customerinfoform);request.getsession ().removeattribute(customerinfoformlist);request.getsession().setattribute(customerinfoformlist, customerinfolist);target = success;return mapping.findforward(target);8.在strut

32、s-config.xml文件中对动作类进行配置,关键代码如下所示: 9.在/webcontent/customerinfo目录中新建customerinfoadd3030098131.jsp,关键代码如下:添加客户信息客户名称企业性质/方法相同,在此省略其它字段            10. 在com.wxit.action中新建customerinfoaddaction3030098131,关键代码如下所示: connection conn = null;string target

33、= failure;customerinfoform3030098131 customerinfoform = (customerinfoform3030098131) form;try conn = dbconnection.getconnection();statement stmt = conn.createstatement();string query = insert into customerinfo(customername,enterprisecharacter,customerrank,customertype,customeraddress,customermailcod

34、e,enterprisecharger,bankaccount,taxaccount,customerwebsite,customertelephone,customerfax)+ values(+ customerinfoform.getscustomername3030098131()+ ,+ customerinfoform.getsenterprisecharacter3030098131()+ ,+ customerinfoform.getscustomerrank3030098131()+ );/方法相同,在此省略其它字段stmt.execute(query);target = s

35、uccess;system.out.println(您已经成功添加该客户信息!);return mapping.findforward(target);11.在struts-config.xml文件中配置添加客户信息动作类,关键代码如下所示: 12.在/webcontent/customerinfo目录中新建customerinfomodify3030098131.jsp,关键代码如下:更新客户信息客户名称html:text property=scustomername3030098131value=style=width:100%; /企业性质html:text property=sente

36、rprisecharacter3030098131 value=style=width:100%; /方法相同,在此省略其它字段           html:hidden property=icustomerid3030098131value=style=width:100%; / 13.在com.wxit.action中新建customerinfomodifyaction3030098131,关键代码如下所示: connection conn = null;string targe

37、t = failure;int icustomerid=integer.valueof(request.getparameter(icustomerid3030098131).tostring();customerinfoform3030098131 customerinfoform =new customerinfoform3030098131();try conn = dbconnection.getconnection();statement stmt = conn.createstatement();string query = select* from customerinfo where customerid=+icustomerid;resultset rs=stmt.executequery(query);while(rs.next()customerinfoform.seticustomerid3030098131(rs.getint(1);customerin

温馨提示

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

评论

0/150

提交评论