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

raksmart:年中大促,美国物理机$30/月甩卖;爆款VPS仅月付$1.99;洛杉矶/日本/中国香港多IP站群$177/月

RAKsmart怎么样?RAKsmart发布了2021年中促销,促销时间,7月1日~7月31日!,具体促销优惠整理如下:1)美国西海岸的圣何塞、洛杉矶独立物理服务器低至$30/月(续费不涨价)!2)中国香港大带宽物理机,新品热卖!!!,$269.23 美元/月,3)站群服务器、香港站群、日本站群、美国站群,低至177美元/月,4)美国圣何塞,洛杉矶10G口服务器,不限流量,惊爆价:$999.00,...

搬瓦工:新增荷兰机房 EUNL_9 测评,联通 AS10099/AS9929 高端优化路线/速度 延迟 路由 丢包测试

搬瓦工最近上线了一个新的荷兰机房,荷兰 EUNL_9 机房,这个 9 的编号感觉也挺随性的,之前的荷兰机房编号是 EUNL_3。这次荷兰新机房 EUNL_9 采用联通 AS9929 高端路线,三网都接入了 AS9929,对于联通用户来说是个好消息,又多了一个选择。对于其他用户可能还是 CN2 GIA 机房更合适一些。其实对于联通用户,这个荷兰机房也是比较远的,相比之下日本软银 JPOS_1 机房可...

41云,服务器8折优惠券,200G TCP防御

41云怎么样?41云是国人主机品牌,目前经营产品有国内外云服务器、CDN(高防CDN)和物理机,其中国内外云服务器又细分小类有香港限流量VPS、香港大带宽VPS、香港弹性自选VPS、香港不限流VPS、香港BGP线路VPS、香港Cera+大带宽机器、美国超防VPS、韩国原生VPS、仁川原生VPS、日本CN2 VPS、枣庄高防VPS和金华高防VPS;物理机有美国Cera服务器、香港单程CN2服务器、香...

400电话查询为你推荐
centos6.5linux centos 6.5 怎么安装软件360退出北京时间utc+8 13:30-14:00换成北京时间是什么时候重庆网站制作重庆网站制作,哪家公司服务,价格都比较好?netshwinsockreset游戏出现battlEye Launcher 怎么办yixingjia合家欢是一种什么东西?刚刚网刚刚在网上认识了一个女孩子,不是很了解她,就跟她表白了。12306.com如何登录12306厦门三五互联科技股份有限公司厦门三五互联做销售怎么样?美国独立美国独立战争的概况骑士人才系统骑士人才系统程序怎么那么难用,刚开始用盗版的不好用,买了正版的还是不好用,不是程序不兼容,就是功能
台湾vps VPS之家 新网域名解析 3322免费域名 132邮箱 免费申请网页 westhost 美国仿牌空间 创宇云 tightvnc 发包服务器 网站挂马检测工具 云全民 什么是刀片服务器 卡巴斯基免费试用 ftp免费空间 息壤代理 天翼云盘 爱奇艺会员免费试用 新睿云 更多