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

易探云330元/年,成都4核8G/200G硬盘/15M带宽,仅1888元/3年起

易探云服务器怎么样?易探云是国内一家云计算服务商家,致力香港云服务器、美国云服务器、国内外服务器租用及托管等互联网业务,目前主要地区为运作香港BGP、香港CN2、广东、北京、深圳等地区。目前,易探云推出的国内云服务器优惠活动,国内云服务器2核2G5M云服务器低至330元/年起;成都4核8G/200G硬盘/15M带宽,仅1888元/3年起!易探云便宜vps服务器配置推荐:易探云vps云主机,入门型云...

亚州云-美国Care云服务器,618大带宽美国Care年付云活动服务器,采用KVM架构,支持3天免费无理由退款!

官方网站:点击访问亚州云活动官网活动方案:地区:美国CERA(联通)CPU:1核(可加)内存:1G(可加)硬盘:40G系统盘+20G数据盘架构:KVM流量:无限制带宽:100Mbps(可加)IPv4:1个价格:¥128/年(年付为4折)购买:直达订购链接测试IP:45.145.7.3Tips:不满意三天无理由退回充值账户!地区:枣庄电信高防防御:100GCPU:8核(可加)内存:4G(可加)硬盘:...

无忧云( 9.9元/首月),河南洛阳BGP 2核 2G,大连BGP线路 20G高防 ,

无忧云怎么样?无忧云服务器好不好?无忧云值不值得购买?无忧云,无忧云是一家成立于2017年的老牌商家旗下的服务器销售品牌,现由深圳市云上无忧网络科技有限公司运营,是正规持证IDC/ISP/IRCS商家,自营有国内雅安高防、洛阳BGP企业线路、香港CN2线路、国外服务器产品等,非常适合需要稳定的线路的用户,如游戏、企业建站业务需求和各种负载较高的项目,同时还有自营的高性能、高配置的BGP线路高防物理...

400电话查询为你推荐
您的apple3.2网易yeahflashwind用flashwind这个加速器玩游戏,会被盗号吗?会被封号吗?ldapserverLDAP3是什么360arp防火墙在哪360ARP防火墙哪里下载?商务软件电子商务平台有哪些店铺统计淘宝店运营每天需要统计哪些数据,我要做个表格长沙电话号码升位长沙的座机什么时候变成8位的,急!在线等答案,那如果之前的7位数是不是都会变啊?变成什么样了呢?joomla教程如何获得 Joomla,2.5中 itemid 的值空间导航自定义名称空间导航自定义名称 短一点的
虚拟主机排名 什么是域名 网站域名备案查询 主机优惠码 lamp安装 lunarpages l5639 私服服务器 免费网站监控 godaddy优惠券 京东商城0元抢购 毫秒英文 adroit 支持外链的相册 linode支付宝 德隆中文网 asp空间 香港博客 shuangcheng restart 更多