信息java课程设计电话号码查询系统

400电话查询  时间:2021-03-19  阅读:()

山东建筑大学

Java课程设计报告设计题目 电话号码查询系统

学号 2010121187专业班级信计101

指导教师 王文

1、设计目的

1、通过JAVA课程设计使大家能够将学到的面向对象的设计思想运用在具体工

作和学习中加深对类和对象的理解要求学生对生活中许多具体的事物抽象

出类。

2、通过这次课程设计掌握JAVA的编程思想为后续设计编程打下基础。

3、培养实际操作能力和实践能力为以后的工作打下坚实的基础。

2、总体设计

3、详细设计homework\src\com\work为工作空间bean文件夹下的TelBean.java为Bean类operate文件夹下的TelOperate.java为服务器接收信息端可以对所获取的信息进行相应的方法调用。 Te l Sq l .j a va对数据库中的数据进行增删改查。

sql文件夹下Conn.java为对数据库提供驱动加载等操作。

addInfo.jsp为添加信息页面截图中有相应的运行图index.jsp为首页页面信息l istInfo.jsp为查询之后显示信息的页面searchInfo.jsp为查询条件选择页面

4、调试与测试

调试中部分功能的测试结果及截图

1、 电话管理功能列表

2、添加电话号码

添加成功

3、 显示所有电话号码信息

4、 按姓名查询功能及查询结果

查询结果

5、按电话号码查询功能及查询结果

查询结果

6、按部门查询

5、源程序清单和执行结果ifexists(select*fromdbo.sysobjectswhereid=object_id(N' [dbo] .[search]')andOBJECTPROPERTY(id,N' Is UserTa ble')=1)droptable[dbo] .[search]

GO

CREATETABLE[dbo] .[search] (

[name] [nvarchar](20)COLLATEChinese_PRC_CI_ASNOTNULL,

[tel] [varchar](11)COLLATEChinese_PRC_CI_ASNULL,

[dep] [nvarchar](20)COLLATEChinese_PRC_CI_ASNULL

)ON[PRIMARY]

GO

Beanpackagecom.work.bean;

publ icclassTelBean{privateStringname;privateStringtel;privateStringdep;publ icStringgetName(){returnna me;

}publ icvoidsetName(Stringname){this.name=name;

}publ icStringgetTel(){retu rntel;

}publ icvoidsetTel(Stringtel){this.tel=tel;

}publ icStringgetDep(){returndep;

}publ icvoidsetDep(Stringdep){this.dep=dep;

}

}

Operate

Teloperatepackagecom.work.operate;importjava. io. IOException;importjava. io.PrintWriter;importjava.net.URLDecoder;importjava.uti l .ArrayList;importjavax.servlet.ServletException;

importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importcom.work.bean.TelBean;publ icclassTelOperateextendsHttpServlet{

**

*ThedoGetmethodoftheservlet.<br>

*

*Thismethodiscal ledwhenaformhasitstagvaluemethodequalstoget.

*

*@paramrequesttherequestsendbythecl ienttotheserver

*@paramresponsetheresponsesendbytheservertothecl ient

*@throwsServletExceptionifanerroroccurred

*@throwsIOExceptionifanerroroccurred

*/publ icvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException, IOException{request.setCharacterEncoding("utf-8");response.setCharacterEncoding("utf-8");

//初始化

PrintWriterpw=response.getWriter();

Stringtype=request.getParameter("type");

Stringname=request.getParameter("username");

Stringtel=request.getParameter("tel");

Stringdep=request.getParameter("dep");

TelSqltelSql=newTelSql();

//根据出入type判断操作方式if(type.equals("search")){

//根据条件查询

ArrayList<TelBean>searchList=telSql .geTelListByInfo(name,tel,dep);request.getSession().setAttribute("l istRes ult",searchList);request.getRequestDispatcher("l istInfo.jsp").forward(request,response);}elseif(type.equals("add")){

//添加if(telSql .addTel Info(name,tel,dep))pw.print("true");else

pw.print("false");

}elseif(type.equals("l ist")){

//列表

ArrayList<TelBean>displayList=telSql .geTelList();request.getSession().setAttribute("l istResult",displayList);request.getRequestDispatcher("l istInfo.jsp").forward(request,response);}elseif(type.equals("del")){

//删除指定信息telSql .delTel Info(name);

ArrayList<TelBean>displayList=telSql .geTelList();request.getSession().setAttribute("l istResult",displayList);request.getRequestDispatcher("l istInfo.jsp").forward(request,response);}

}

**

*ThedoPostmethodoftheservlet.<br>

*

*Thismethodiscal ledwhenaformhasitstagvaluemethodequalstopost.

*

*@paramrequesttherequestsendbythecl ienttotheserver

*@paramresponsetheresponsesendbytheservertothecl ient

*@throwsServletExceptionifanerroroccurred

*@throwsIOExceptionifanerroroccurred

*/publ icvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException, IOException{this.doGet(request,response);

}

}

Telsqlpackagecom.work.operate;importjava.sql .*;importjava.uti l .*;importcom.work.bean.*;importcom.work.sql .*;

特网云,美国独立物理服务器 Atom d525 4G 100M 40G防御 280元/月 香港站群 E3-1200V2 8G 10M 1500元/月

特网云为您提供高速、稳定、安全、弹性的云计算服务计算、存储、监控、安全,完善的云产品满足您的一切所需,深耕云计算领域10余年;我们拥有前沿的核心技术,始终致力于为政府机构、企业组织和个人开发者提供稳定、安全、可靠、高性价比的云计算产品与服务。公司名:珠海市特网科技有限公司官方网站:https://www.56dr.com特网云为您提供高速、稳定、安全、弹性的云计算服务 计算、存储、监控、安全,完善...

易探云:买香港/美国/国内云服务器送QQ音乐绿钻豪华版1年,价值180元

易探云产品限时秒杀&QQ音乐典藏活动正在进行中!购买易探云香港/美国云服务器送QQ音乐绿钻豪华版1年,价值180元,性价比超级高。目前,有四大核心福利产品推荐:福利一、香港云服务器1核1G2M,仅218元/年起(香港CN2线路,全球50ms以内);福利二、美国20G高防云服务器1核1G5M,仅336元/年起(美国BGP线路,自带20G防御);福利三、2G虚拟主机低至58.8元/年(更有免费...

印象云七夕促销,所有机器7折销售,美国CERA低至18元/月 年付217元!

印象云,成立于2019年3月的商家,公司注册于中国香港,国人运行。目前主要从事美国CERA机房高防VPS以及香港三网CN2直连VPS和美国洛杉矶GIA三网线路服务器销售。印象云香港三网CN2机房,主要是CN2直连大陆,超低延迟!对于美国CERA机房应该不陌生,主要是做高防服务器产品的,并且此机房对中国大陆支持比较友好,印象云美国高防VPS服务器去程是163直连、三网回程CN2优化,单IP默认给20...

400电话查询为你推荐
NET_SessionIdasp操作httpapple.com.cn苹果官网怎么序列号查询激活时间phpcms模板phpcms在后台怎样改模板govyapiaonimai跪求朴妮唛的的韩文歌,不知道是哪一部的,第一首放的是Girl's Day《Oh! My God》。求第三首韩文歌曲,一男一女唱的。碧海银沙网怎样在碧海银沙网里发布图片?电子商务世界电子商务都有什么内容厦门三五互联科技股份有限公司厦门三五互联科技股份有限公司怎么样?三五互联股票三五互联是什么股票
浙江vps vir 轻博客 柚子舍官网 最好的免费空间 1g空间 支付宝扫码领红包 linux使用教程 流媒体加速 东莞服务器托管 免费php空间 accountsuspended 侦探online 宿主机 远程主机强迫关闭了一个现有的连接 大容量存储控制器 大容量存储方案 大容量存储控制器驱动 万网主机代理 电脑主机嗡嗡响 更多