安徽省巢湖学院计算机与信息工程学院课程设计报告课程名称《Java大学生实用教程》题目名称通讯录管理系统院(系)计算机信息与工程学院专业(班级)10电子商务姓名朱禄城学号10011058目录一、设计题目·················································1二、设计要求·················································1三、总体设计·················································13.1系统功能框架·········································13.2系统功能说明··········································3四、详细设计···················································31.数据结构设计············································32.系统模块设计············································10五、运行结果·················································13一.设计题目随着社会的进步与发展,通讯越来越密切。希望能通过对java课程设计的学习和掌握来编写一个通讯录管理系统。二.设计要求(1)只能使用Java语言,采用面向对象方法进行设计,要求源程序要有适当的注释,使程序容易阅读。(2)程序必须与数据库进行通信。(3)系统必须是图形用户界面的形式并连接数据库三.总体设计3.1系统总体功能框架图3.2系统功能说明(1)具有新用户注册功能。(2)具有注册用户登录功能。(3)具有数据的录入功能。(4)具有数据查询功能,可以实现查询全部信息和按条件执行查询。(5)具有按条件删除数据功能。注册新用户登录通讯录管理系统系统管理用户数据增添功能用户数据查询功能用户数据删除功能用户数据统计功能全部查询按条查询退出系统录入数据库(6)具有统计功能4.详细设计4.1数据结构设计(java程序设计)//登录系统packagecom.ibm.etp.addressbook.action;importjava.util.HashMap;importjava.util.List;importcom.ibm.etp.addressbook.pojo.User;importcom.ibm.etp.addressbook.service.LoginService;importcom.opensymphony.xwork2.ActionSupport;publicclassLoginActionextendsActionSupport{privatestaticfinallongserialVersionUID=1L;publicStringusername;publicStringpassword;privateStringmessage;@OverridepublicStringexecute()throwsException{HashMapObject,Objectresult=newHashMapObject,Object();ListUserlist=null;System.out.println(username);if(username==null||username.trim().length()==0){result.put(success,false);result.put(msg,login.username.empty);}elseif(password==null||password.trim().length()==0){result.put(success,false);result.put(msg,login.password.empty);}else{LoginServicels=newLoginService();list=ls.checkLogin(username);}if(list==null){result.put(success,false);result.put(msg,error.user.not.exist);}elseif(list.get(0).getPassword().equals(password)){result.put(success,true);result.put(msg,login.success);}else{result.put(success,false);result.put(msg,error.password.wrong);}if((Boolean)result.get(success)){message=(String)result.get(msg);returnsuccess;}else{message=(String)result.get(msg);returnerror;}}publicStringgetMessage(){returnmessage;}publicvoidsetMessage(Stringmessage){this.message=message;}publicvoidsetUsername(Stringusername){this.username=username;}publicvoidsetPassword(Stringpassword){this.password=password;}publicStringgetUsername(){returnusername;}publicStringgetPassword(){returnpassword;}}//增加记录packagecom.ibm.etp.addressbook.action;importjava.util.HashMap;importjava.util.List;importcom.ibm.etp.addressbook.pojo.User;importcom.ibm.etp.addressbook.service.LoginService;importcom.opensymphony.xwork2.ActionSupport;publicclassLoginActionextendsActionSupport{privatestaticfinallongserialVersionUID=1L;publicStringusername;publicStringpassword;privateStringmessage;publicStringexecute()throwsException{HashMapObject,Objectresult=newHashMapObject,Object();ListUserlist=null;System.out.println(username);if(username==null||username.trim().length()==0){result.put(success,false);result.put(msg,login.username.empty);}elseif(password==null||password.trim().length()==0){result.put(success,false);result.put(msg,login.password.empty);}else{LoginServicels=newLoginService();list=ls.checkLogin(username);}if(list==null){result.put(success,false);result.put(msg,error.user.not.exist);}elseif(list.get(0).getPassword().equals(password)){result.put(success,true);result.put(msg,login.success);}else{result.put(success,false);result.put(msg,error.password.wrong);}if((Boolean)result.get(success)){message=(String)result.get(msg);returnsuccess;}else{message=(String)result.get(msg);returnerror;}}publicStringgetMessage(){returnmessage;}publicvoidsetMessage(Stringmessage){this.message=message;}publicvoidsetUsername(Stringusername){this.username=username;}publicvoidsetPassword(Stringpassword){this.password=password;}publicStringgetUsername(){returnusername;}publicStringgetPassword(){returnpassword;}}//删除记录packagecom.ibm.etp.addressbook.action;importjava.util.ArrayList;importcom.ibm.etp.addressbook.pojo.Record;importcom.ibm.etp.addressbook.service.DeleService;importcom.opensymphony.xwork2.ActionSupport;publicclassDeleActionextendsActionSupport{privateintid[];publicStringmessage;privatebooleansuccess=true;publicbooleanisSuccess(){returnsuccess;}privateArrayListRecordlist=newArrayListRecord();publicArrayListRecordgetList(){returnlist;}publicintgetId(inti){returnid[i];}publicint[]getId(){returnid;}publicvoidsetId(int[]id){this.id=id;}publicStringgetMessage(){returnmessage;}publicvoidsetMessage(Stringmessage){this.message=message;}publicStringexecute()throwsException{DeleServiceds=newDeleService();list=ds.removeRecord(this);try{success=true;returnSUCCESS;}catch(Exceptione){success=false;returnERROR;}}}//修改记录packagecom.ibm.etp.addressbook.action;importcom.ibm.etp.addressbook.service.UpdateService;importcom.opensymphony.xwork2.ActionSupport;publicclassUpdateActionextendsActionSupport{privateintid;privateStringna