信息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 .*;

美国云服务器 1核 1G 30M 50元/季 兆赫云

【双十二】兆赫云:全场vps季付六折优惠,低至50元/季,1H/1G/30M/20G数据盘/500G流量/洛杉矶联通9929商家简介:兆赫云是一家国人商家,成立2020年,主要业务是美西洛杉矶联通9929线路VPS,提供虚拟主机、VPS和独立服务器。VPS采用KVM虚拟架构,线路优质,延迟低,稳定性强。是不是觉得黑五折扣力度不够大?还在犹豫徘徊中?这次为了提前庆祝双十二,特价推出全场季付六折优惠。...

个人网站备案流程及注意事项(内容方向和适用主机商)

如今我们还有在做个人网站吗?随着自媒体和短视频的发展和兴起,包括我们很多WEB2.0产品的延续,当然也包括个人建站市场的低迷和用户关注的不同,有些个人已经不在做网站。但是,由于我们有些朋友出于网站的爱好或者说是有些项目还是基于PC端网站的,还是有网友抱有信心的,比如我们看到有一些老牌个人网站依旧在运行,且还有新网站的出现。今天在这篇文章中谈谈有网友问关于个人网站备案的问题。这个也是前几天有他在选择...

美国200G美国高防服务器16G,800元

美国高防服务器提速啦专业提供美国高防服务器,美国高防服务器租用,美国抗攻击服务器,高防御美国服务器租用等。我们的海外高防服务器带给您坚不可摧的DDoS防护,保障您的业务不受攻击影响。HostEase美国高防服务器位于加州和洛杉矶数据中心,均为国内访问速度最快最稳定的美国抗攻击机房,带给您快速的访问体验。我们的高防服务器配有最高层级的DDoS防护系统,每款抗攻击服务器均拥有免费DDoS防护额度,让您...

400电话查询为你推荐
操作http重庆电信断网这几天为什么重庆电信的网络总是这么不稳定建企业网站建立一个企业网站要多少费用申请支付宝账户支付宝账户怎么申请?flashfxp注册码找flashfxp3.4注册码信息cuteftp申请400电话400电话申请怎么办理?是不是免费的?qq头像上传失败我怎么总是QQ上传头像失败,独立访客百度统计中访客数(UV)什么意思谷歌新漏洞谷歌浏览器真的有沙箱吗?真的不中毒?
国外域名 php主机租用 拜登买域名批特朗普 x3220 t楼 2014年感恩节 parseerror win8升级win10正式版 地址大全 免费ddos防火墙 京东商城双十一活动 日本bb瘦 idc资讯 网络空间租赁 香港新世界中心 网页提速 atom处理器 创速 塔式服务器 美国代理服务器 更多