编号
毕业设计(文)
影院订票系统设计实现
Design and Realization of Cinema Booking System
学院名称
专业名称
学生姓名
学号
指导教师
20XX年X月X日
摘
已网络视生活中部分浪费精力时间事情网络技术完美实现网络方便快捷电影业发展带契机想预订电影票直接电影院现然团购网站提供电影票线预订功法满足线购买预订求现开发符合现代生活惯影院订票系统非常重
整体设计采Struts框架业务层实现采MVC分层模式实现页面请求处理设计采BS架构JSP技术进行动态页面设计设计实现新电影特价电影查订单购票专区会员信息修改预订排行等动态页面台数库选SQL Server 2005数库Web服务器TomcatTomcatApache公司组织开发种JSP引擎身具Web服务器作独立Web服务器快速开发方面考虑运Hibernate框架实现数库项操作影院订票系统实现提前解新电影快速订购电影票愿更生活快节奏节省时间系统快速信息更新量信息储存应方便等特点户订票带舒适网订票关注环境
系统建立拥影片信息资源影院互联网实现影片展示电影预告片影视排行榜网订票新片发行介绍等功系统仅成影院互联网文化交流窗口提供具广泛参性娱乐性便民服务
关键词:影院订票系统团购网站便民服务
Abstract
Nowadays people treat the Internet as a part of life Various kinds of timeconsuming and energyconsuming task can be realized through the Internet perfectly Also the film industry is motivated by the convenience of the Internet In the past people have to walk in the cinema if they want to book tickets Today some groupbuying websites provide online booking function however it cannot meet the increasing demand of online purchase and reservation Therefore it is necessary to develop an online booking system which can satisfy modern residents’ living habits
The overall design uses Struts framework To process requests from the front page MVC layered model is implemented in the background business layer In this design BS framework and JSP technology are used in the dynamic pages The dynamic pages includes new movies specialprice movies orders booking zone membership modification and reservation ranking In addition SQL Server 2005 database is selected as the background database Tomcat is applied in the Web server Tomcat is a kind of JSP engine developed by the Apache Company Because Tomcat contains Web server itself can be used as an independent server Considering the rapid development Hibernate framework is used to handle the operation in the database Cinema booking system satisfies people’s desire of knowing new movies in advance and booking tickets quickly Moreover it saves much time for the modern people with fast pace of life Depending on the characteristics of fast information updating large amount of information storage and easy application the system provides comfortable online booking environment for users
The establishment of the system makes the cinema which has movie resources be able to present the movie show movie trailers movie rankings booking tickets introduction of new movies on the Internet The system will not only become a communication window on the Internet between the cinema and users but also provides a high participation rate and recreational convenience service
Key words cinema ticket buying system groupbuying websites convenience services
目 录
摘 I
Abstract II
第1章 绪 1
11 影院订票系统开发背景分析 1
12 国外发展现况 1
13 影院订票系统达目标 2
第2章 行性分析 3
21 技术行性 3
22 运行环境行性 3
23 软件行性 4
231系统开发语言JSP 4
232 SQL Server 2005介绍 5
第3章 需求分析 6
31 需求分析 6
32 数流图 7
33 数字典 8
34 系统工作流程图 10
第4章 总体设计 11
41 系统总体功结构图 11
42 系统ER图 12
43 系统功设计目标 12
44 系统功模块划分 13
第5章 数库设计 15
51 数库理基础 15
52 数表设计 15
第6章 详细设计编码 18
61 前台首页设计 18
611 前台首页概述 18
612 前台首页实现 18
62 户信息模块设计 20
621 户信息模块概述 20
622 户注册实现 20
63 订单信息模块设计 22
631 订单信息模块概述 22
632 订单信息模块实现 22
64 电影浏览模块设计 24
641 电影浏览模块概述 24
642 电影浏览模块实现 24
65 台登陆设计 26
651 台登陆概述 26
652 台登陆实现 26
66 台首页设计 27
661 台首页概述 27
662 台首页实现 28
67 添加电影信息模块设计 30
671 添加电影信息模块概述 30
672 添加电影信息模块实现 30
第7章 系统调试测试 32
71 系统测试原理原 32
711 系统测试原理 32
712 系统测试原 32
72 影院订票系统测试 32
73 调试程调试结果分析 33
731登陆功测试 33
732 理员理功测试 33
第8章 总结 34
参考文献 35
致 谢 36
附 录 37
第1章 绪
11 影院订票系统开发背景分析
精神文明建设越越重视天电影行业市场越越电影种类数量越越然客流量增时导致电影院理难度增应种情况设计开发套电影订票系统便成件现实意义工作电影订票网站相传统工售票模式着优越性信息更新速度快信息储存量应方便等特点户订票带极方便展着电影行业发展套系统会发挥更作伴着Internet蓬勃发展电影票预订系统作电子商务种形式正高效低成优势逐步成新兴营模式理念已满足信息浏览发布渴着够充分享受网络带更便利确客户足出户便方便快捷选购喜欢电影正电影票预订系统客户带处
敏锐网络商家然会错样绝机会越越网站投身提供网络预订服务行列中基Internet全球电子商务框架正形成时运面象思想面象Java语言基础Java语言重特性身种纯面象程序设计语言Java提倡万物皆象语法中类外定义单纯数函数说Java语言外部数类型象元素通类象访问[1]
根CNNIC统计结果截止2004年1月中国互联网户7950万407网民年里网预订历说明中国网预订户达32357万数字17左右速度增长2006年中国网预订户达6962万说明中国发展网预订具良群众基础网预订方式日趋家接受设计具电子商务功电影院购票系统网站具非常开发应前景
12 国外发展现况
目前国中高级电影院数量规模扩国外星级影院纷纷着陆中国影院间竞争谓日益激烈配备安全高效灵活客户订票系统影院加强客户服务质量提高客户服务水维护公众形象提高工作效率必发挥重作电影院说订票系统扩服务范围扩影院影响减少营业费稳固影院重客源着重辅助作站前观电影观众角度影院提供种服务提供更方便受时间空间限制享受影院提供服务[2]10年前推出团购网站类似购买兴趣买家聚集网获团体折扣受欢迎购买网站交易美国2008年开始新集团购买迅速取巨成功已广泛采国家
[3]电影院作快速增长济行业提高国民生活质量发展区济中发挥着越越重作网预订酒店机票越越普遍提高企业效率现代化计算机信息处理技术够合理利网络资源快速反映出户电影票价放映时间查够针户求影城理员会员理功第时间提供准确精细迅速服务节省力物力资源仅影城创造良济效益广影迷提供方便快捷购票台
13 影院订票系统达目标
设计实现套完整高效基BS架构网订票系统通网订票系统实现提高开发验时解决窗口售票效率低问题电子影票系统网络售票台完成影院订票系统全部功通电影院计算机售票系统相连完成相关票务功电子影票系统负责维护电影院票务数相电影院计算机售票系统售票终端[4]通系统节约更时间网络电影票预订仅传统电影院业发展补充未电影院业发展方电影院商家利网络技术瞄准市场增加身业务数量时方便广消费者足出户预订需电影票
第2章 行性分析
21 技术行性
设计采SQL Server 2005数库JSP进行开发解决电影票预订系统承载量数预订流程较繁琐问题具高稳定性安全性确保电影系统安全运营种设计仅影院订票系统走行业前列影院更机会获市场产生更济效益客户更愿意系统客户操作更方便保证客户资金安全促进企业竞争力提高
JSPServlet开发Web应程序时Servlet生成HTML页面样代码必须Servlet编写JSP生成HTML页面业务逻辑显示逻辑混杂起代码维护量开发效率低
解决述问题实现MVC模式Struts框架MVC全名Model View Controller模型(model)-视图(view)-控制器(controller)缩写种软件设计典范组织代码种业务逻辑数显示分离方法Struts框架Java服务器端实现MVC设计模式创建JavaWeb应程序时轻易分离表示层业务数层[5]
伴着计算机硬件方面飞速发展现电脑已够出色完成作Web服务器机务购买台者台足够作企业网站电脑型电影院说非常容易容易理维护
户未登录情况浏览需订票情况户通注册获账号登录系统登陆户进行电影票预订购买等部分JSP设计页面分类通数库建立相关表便进行查修改删
系统高权限系统中发挥着重作设计理员拥高理权限理员够完成网站维护理工作数库中权限功理员设置权限理员电影信息进行新增删订单信息进行处理时理员户信息进行理
22 运行环境行性
系统设计国际流行设计理念系统兼容性非常历年发展逐渐接收够简单操作系统理员操作需定验者培训段时间通前台链接进入台然通登录界面输入户名密码通数库操作验证成功进入台理进入操作完全鼠标键盘输入户体验非常操作系统稳定兼容性强Windows XP者操作简单方便功强Windows 7
23 软件行性
231系统开发语言JSP
JSP(Java Server Page服务器网页)1998年开始出现新技术Sun公司倡导许公司参起建立种动态网页技术标准基JavaServlet整Java体系web开发技术传统网页HTML文件(*htm*html)中加入脚片段JSP标记(Tag)构成JSP网页(*jsp)JSP技术创建显示动态生成容web页面提供简便方法JSP作Java家族员承袭Java特点跨台特性次编译处运行
JSPServlet体两面基Servlet实现功JSP做JSP容器转译Servlet源代码动编译class文件载入class文件然生成Servlet象[6]
框架身指种够项目中概念结构CSS框架样种结构CSS代码集合文件说开源前端开发工具包里面包含支持该框架字体排版表单样式表格布局等等开发程中网页工程师需html元素加需类快速该风格相关组件需传统编码样实现现成熟CSS框架拥较高通性浏览器兼容性省量测试修改时间[7]
HTML5技术出现移动互联网应呈现出Web应化应Web化发展趋势改变目前移动应App王格局模糊浏览区操作系统间界限[8]
国外量JSP作网络应程序开发工具国JSP流开发技术JSP强优势许网站已准备转JSP利JSP开发动态网站
JSP面服务器支持浏览器Web服务器JSP引擎遇访问JSP网页请求时JSP引擎请求象发送服务器端相关组件JavaBean组件ServletEJB等然服务器端组件处理请示需数库数存储中检索信息然服务器端组件响应象返回JSP引擎JSP引擎响应象传递JSP页面根JSP页面HTML格式完成数编排Web服务器JSP引擎格式化JSP页面HTML格式返回客户浏览器前网站构建中广泛采浏览器——Web服务器——台数库三层架构模式JSP程序操作服务器端执行网络传送客户端仅结果
JavaWeb项目开发程中业务逻辑界面分离业务逻辑开发员负责开发JavaBean功代码设计JavaBean类界面开发员负责项目界面设计实现通生成相关JavaBean类象进行JavaBean类属方法调终实现功界面结合
提高开发效率项目性JavaWeb项目更具扩展性灵活性健壮性[9]
232 SQL Server 2005介绍
次网站设计选Microsoft SQL Server 2005作台数库SQL Server数库微软公司款关系型数库系统专门分布式客户机服务器计算设计出众数库理台优势扩展性高性理支持堆成处理结构ODBC储存程强壮事物处理力支持SQL语句中SQL语句执行数库中提取数更新删数库中数等等种样操作完成数库操作[10]
SQL Server 2005项全面完整数库分析产品助浏览器实现数库查询功容丰富扩展标记语言(XML)支持特性均力证明SQL Server 2005全面支持Web功数库解决方案时SQL Server 2005伸缩性性方面保持着项基准测试纪录两方面特性企业数库系统激烈市场竞争中克敌致胜关键SQL Server 2005推出组复杂新安全特性:强灵活基角色服务器数库应程序配置安全性集成安全性审核工具踪18安全事件子事件精密文件网络加密支持包括SSL(安全套接字层)SQL Server 2005已通美国政府C2级安全性认证具备目前业界高等级安全性
SQL Server 2005型数库理系统SQL Server 2005 具安全性更快存储速度高度兼容性应SQL Server 2005作台数库系统开发提供强力支持软件运行提供坚实基础
JDBC技术Java数库连接技术简称组Java语言编写类接口组成种关系数库提供访问Sun公司提供JDBC接口规范数库厂商会根该接口规范提供针数库具体实现JDBC[11]系统SQLServer2005驱动完成Java数库访问
第3章 需求分析
31 需求分析
需求分析软件设计重环节阶段订票系统应情况作全面调查确定系统目标系统需基础数数处理求进行分析确定户需求
系统功分电影信息浏览电影票预订付款电影信息动态更新电影信息销售排行特价电影新电影电影分类型进行展示方便户喜欢类型订购影票预订操作订购数量起订购电影页明显方放置户登录注册减少操作步骤果需目购买指定电影直接页搜索进入相应电影页面体现电子商务区传统优势顾客空闲时间想电影时直接商务网站查找时间段影院期放映电影安排选定直接通王国银行第三方支付台付款载门票证放映时间直接持证影院[12]理员通菜单操作前台显示模块需修改时候需找修改节约量时间
系统分前台台:前台户注册登录系统线订购影票电影信息查询修改资料等台理员户订单处理更新电影类电影预告信息修改等
系统部分功模块需求:
(1)户注册:添加户详细信息方便户登录订单理
(2)户登录:负责户注册完成普通户登录
(3)电影浏览:查存系统中户感兴趣电影
(4)电影订购:想观电影电影票进行预订购买
(5)电影查询:果想直接观电影根电影名进行查询
(6)订单修改:订购完成进行修改
(7)修改密码:户安全密码需定期修改根原密码进行修改
(8)修改信息:信息发生变化时更新便更客户服务
(9)退出:客户隐私泄露完系统时候需安全退出
(10)理员功:理前台信息发布更新负责户账户安全处理户订单
外企业营销商普通客户样浏览网站外需网站进行理企业需定期更新现电影详细信息电影票预订动态联系方式必时企业介绍做更改消费者通网站提交种订单够进行处理方便预订
32 数流图
数流图简称DFDSA方法中表示系统逻辑模型种工具图中没具体物理元素描绘信息系统中流动处理情况图形方式描述数系统中流动处理程反映系统必须完成逻辑功种功模型
网影城售票系统数流程:系统操作数源普通户注册户理员三种首先系统理员根户需某信息保存数库中然进行发布权限户库信息进行添加修改删处理
(1) 顶层数流图31示
图31 影院订票系统顶层数流图
(2)层数流图32示
图32 影院订票系统层数流图
33 数字典
数字典(Data dictionary)种户访问记录数库应程序源数目录动数字典指数库应程序结构进行修改时容DBMS动更新数字典动数字典指修改时必须手工更新容数字典数字典预留空间数库储存信息数库身
字典作词汇定义解释结构化分析中数字典作数流图成分定义说明换句话说数流图成分定义解释文字集合数字典数字典数流图种成分起注解说明作成分赋实际容外数字典系统分析中需说明问题进行定义说明数字典描述容:数流数元素数存储加工外部项中数元素组成数流基成分系统分析中数字典起着重作
1.理员表数字典卡片
名称:理员表
名:()
描述:数库中记录增加修改理员信息信息表
定义:理员表理员姓名+密码
位置:理员表
图33 理员表数字典卡片
2.会员信息表数字典卡片
名称:会员信息表
名:()
描述:数库中记录会员信息信息表
定义:会员信息表会员账号+姓名+性+密码+Email+电话+址+邮编
位置:会员信息表
图34 会员信息表数字典卡片
3.电影信息表数字典卡片
名称:电影信息表
名:()
描述:数库中记录电影信息信息表
定义:电影信息表电影编号+电影类型编号+电影名称+电影介绍+正常价+特价+点击数+购买数+推荐+推荐日期
位置:电影信息表
图35 电影信息表数字典卡
4.订单详细信息表数字典卡片
名称:订单详细信息表
名:()
描述:数库中记录订单详细信息信息表
定义:订单详细信息表准考证号+属课程+考试时间
位置:订单详细信息表
图36 订单详细信息表数字典卡片
5.订单列表信息表数字典卡片
名称:订单列表信息表
名:()
描述:数库中记录订单列表信息信息表
定义:订单列表信息表姓名+址+邮编+电话+邮箱+应付款项+备注+单时间+送 货时间+处理状态+送货备注
位置:订单列表信息表
图37 订单列表信息表数字典卡片
34 系统工作流程图
(1) 前台系统流程图图38示
未提交
找回密码
修改信息
注 册
户
提交
订单
预订影票
前台页 面
登 录
否
搜索电影
提交
退 出
付 款
影票
图38 前台系统流程图
(2)台系统流程图图39示
修改密码
户理
成功
台
首页
登 录
电影类
理员
影票理
未成功
订单理
留言理
退出系统
图39 台系统流程图
第4章 总体设计
根户需求方案行性程序设计成三部分分前台台数库前台时候户登录网站页查询类型电影信息果需预订影票前点击电影预告图片进入预订页面样设计方便客户目然新电影信息作购买指引网站台作理员操作部分台效率决定系统体验数库增加查询删语句系统流畅度影响系统间连接首先保证流畅性
前台完全面户求够详细信息反馈户户够清晰想容
台部分整系统核心部分需维护前台台部分前台信息需台理员登陆进行相应更改系统设计时候理员操作便捷系统前台部分结合部分样理员操作数量时候减少步骤提高理效率
数备份容灾基础防止系统出现操作失误系统障导致数丢失全部部分数集合应机硬盘阵列复制存储介质采置外置磁带机进行冷备份外采网络备份外提高技术保证保存电脑者数盘等设备丢失电子数进行抢救恢复[13]
41 系统总体功结构图
图41 系统功结构图
电影票预订系统
理员
公告
修改订单
修改信息
订单查询
修改密码
电影查询
电影浏览
户登录
户注册
图41 系统功结构图
42 系统ER图
图42 系统ER图
图42 系统ER图
43 系统功设计目标
理系统功设计目标:
(1)户体验:现设计软件首满足条件户体验设计户体验系统更促进户兴趣系统设计简单流畅设计界面操作户方便满足层次户需求
(2)先进程序结构:国际流行软件编程发挥潜延长系统生命周期系统维护理较容易够影票时发布系统户第时间观
(3)安全性高系统台权限较完善户安全系统订票购买理员够分配模块理权限保证系统安全运行
(4)模块化设计方法:种设计模式够系统良扩展性开发够根需方便更改维护
(5)查询功强:根电影名查询根类型属列表查询
44 系统功模块划分
模块分析描述系统需求程需需求分析中感性描述进行抽象提取出实现功整系统开发关键程层次模块结构系统划分干子系统子系统划分干模块模块指具备输入输出逻辑功运行程序部数四种属性组程序结构化系统设计中模块般功划分通常称功模块合理功模块划分够极限度减少重复劳动提高开发工作效率增系统维护性
分析根目开发者提出需求间建立种理解沟通机制根户操作需求系统划分模块划分功进行描述根需求分析系统功设计目标结合实际情况系统功模块设计分模块:
(1)页:里见系统户操作功电影信息时设留言功
(2)户注册:通常网站会户需预订购买等敏感操作时候需唯账号保证户安全便利防止账号丢失系统设计通关键信息找回户账号更户更服务中电话Email较重需信息进行处理方便户预订付款
(3)户登录:方便户预订购买系统需注册满足浏览购买操作利进行户注册进行登录进行购票查询等想完成系列操作
(4)电影浏览:成功登录户分页浏览电影预告想预订影票提交订单页面果户没注册直接进入者没成功登陆进入页面连接户登录页面时电影预览画面新电影展示热销电影展示系统动罗列出售出量电影
(5)订购电影票:成功登陆户该页面定购需电影果户没注册直接进入者没成功登陆进入页面连接户登录页面进入进行电影票订购
(6)查订单:户提交订单会产生订单号通订单号查询订单信息前状态需根户录入订单号数表中查询处应预订信息
(7)修改订单:成功登陆户该页修改删已订购电影票果户没注册直接进入者没成功登陆进入页面连接户登录页面
(8)电影查询:成功登陆户该页查找需图书果户没注册直接进入者没成功登陆进入页面连接户登录页面登录进行电影查询操作
(9)修改密码:成功登陆户该页修改密码果户没注册直接进入者没成功登陆进入页面连接户登录页面
(10)修改信息:成功登陆户该页修改初注册时信息果户没注册直接进入者没成功登陆进入页面连接户登录页面
(11)理员:台理员提供台入口该模块功验证理员身份否拥指定权限理员输入登录账号密码系统通查询数库判断登录账号密码否正确果通验证会弹出提示框提示登录成功然进入台页果错误留前页面
第5章 数库设计
51 数库理基础
数库系统文件系统基础发展历层次数库网状数库关系数库三阶段关系数库采较容易理解接受二维表格组织数发展迅速已成数库产品流
系统前端开发JSP技术台数库采SQLServer2005SQLServer2005数库理系统项全面完整数库分析产品应程序开发速度事务处理运行速度衡量SQLServer2005堪称快捷数库系统
SQLServer2005型数库理系统SQLServer2005具安全性较快存储速度高度兼容性简单易应SQLServer2005作台数库系统开发提供强力支持软件运行提供坚实基础采SQLServer2005作台数库
52 数表设计
字符类型存储字符型数种字符数类型两字节存储字符具体取决该数类型ASCII编码Unicode编码ASCII编码求8二进制位表示字母范围ASCII字符串存储字符型数序列具体分charvarchartext3种中char固定长度varchar变长度text存储量字符[14]
建立数库表:
表51会员信息表存储系统中会员信息
表51 会员信息表
字段名
数类型
默认值
描述
MemberID
Bigint(8)
ID
Name
varchar(20)
Null
姓名
Pwd
varchar(20)
Null
密码
Sex
varchar(20)
Null
性
varchar(20)
Null
电子邮箱
Question
varchar(50)
Null
提示问题
Answer
varchar(50)
Null
问题答案
Phone
varchar(30)
Null
电话
Address
varchar(30)
Null
址
ZipCode
varchar(18)
Null
邮编
表52理员信息表记录系统中理员详细信息
表52 理员信息表
字段名
数类型
默认值
描述
Account
Bigint(8)
理员账号
Name
varchar(20)
Null
姓名
pwd
varchar(20)
Null
密码
表53电影信息表记录系统中电影详细信息
表53 电影信息表
字段名
数类型
默认值
描述
ID
Bigint(8)
编号
ProductType
varchar(20)
Null
类型编号
Name
varchar(20)
Null
名称
Introduce
varchar(20)
Null
介绍
Remark
varchar(20)
Null
说明
MarketPrice
int(4)
0
时常价
MemberPrice
int(4)
0
会员价
smallImg
varchar(30)
nothing
图片相路径
bigImg
varchar(30)
nothing
图片相路径
hitNum
int(4)
0
点击数
buyNum
int(4)
0
购买次数
Recommend
int(4)
0
1推荐0推荐
RecommendDate
datetime(6)
Now()
推荐日期
表54产品类型信息表记录系统中类信息
表54 产品类型信息表
字段名
数类型
默认值
描述
id
Bigint(8)
类型ID(键)
SuperID
int(4)
Null
级类型ID
Name
int(4)
Null
类型ID(备)
表55定单详细信息表记录客户定单中针件商品订货信息
表55 定单详细信息表
字段名
数类型
默认值
描述
ID
Bigint(8)
信息唯标识
orderID
bigint(8)
Null
订单列表ID
productID
bigint(8)
Null
产品ID
productName
varchar(30)
Null
产品名称
price
int(4)
Null
产品单价
Quantity
bigint(8)
Null
订购数量
表56订单列表信息表记录针户订单详细信息
表56 订单列表信息表
字段名
数类型
默认值
描述
ID
Bigint(8)
订单列表编号
memberID
Bigint(8)
Null
会员id
customerName
varchar(20)
Null
客户姓名
Address
varchar(20)
Null
详细址
ZipCode
varchar(20)
Null
邮编
Phone
varchar(30)
Null
电话
varchar(30)
Null
电子邮箱
Payment
varchar(18)
Null
应付款额
Remark
varchar(18)
备注
createDate
datetime(6)
Now()
单时间
state
Int(4)
0
0未处理1已处理
treateDate
datetime(6)
Null
送货日期
treatedRemark
varchar(18)
送货备注
第6章 详细设计编码
61 前台首页设计
611 前台首页概述
户通户登陆模块验证登陆影院订票系统前台首页前台首页前台功导航页面畅销电影新电影特价电影:
(1)订票车链接:链接开户预定电影票
(2)订单链接:户链接开订单信息
(3)信息链接:户通功查注册时填写信息
(4)进入台链接:理员进入台理电影票链接
612 前台首页实现
图61 前台首页
前台首页界面部分代码:
public String index()
{
Map request(Map)ServletActionContextgetContext()get(request)
String sqlfrom TGoods where goodsDel'no' and goodsIsnottejia'yes' order by goodsId desc
List goodsYesTejiaListgoodsDAOgetHibernateTemplate()find(sql)
if(goodsYesTejiaListsize()>5)
{
goodsYesTejiaListgoodsYesTejiaListsubList(0 5)
}
requestput(goodsYesTejiaList goodsYesTejiaList)
sqlfrom TGoods where goodsDel'no' and goodsIsnottejia'no' order by goodsId desc
List goodsNoTejiaListgoodsDAOgetHibernateTemplate()find(sql)
if(goodsNoTejiaListsize()>5)
{
goodsNoTejiaListgoodsNoTejiaListsubList(0 5)
}
requestput(goodsNoTejiaList goodsNoTejiaList)
paihangbang
List goodsListnew ArrayList()
sqlselect sum(goodsQuantity)goodsId from TOrderItem group by goodsId order by sum(goodsQuantity) desc
List listorderItemDAOgetHibernateTemplate()find(sql)
for(int i0i
Object[] b(Object[])listget(i)
int goodsIdIntegerparseInt(b[1]toString())
Systemoutprintln(goodsId+&&)
TGoods goodsgoodsDAOfindById(goodsId)
goodsListadd(goods)
}
if(goodsListsize()>5)
{
goodsListgoodsListsubList(0 5)
}
requestput(goodsList goodsList)
return ActionSupportSUCCESS
}
62 户信息模块设计
621 户信息模块概述
户第次登录时首先网站注册成会员户网站预订注册页面必须填写户基信息户名密码联系电话等信息注意户注册页面registerjsp中户定义JavaScript检验户注册信息允许空便网站户理indexjsp户注册页面接收注册
信息严格滤保证注册户名唯性提交表单需数表中数进行查询果没找插入数表时提示注册成功否提示户已占请重新注册
622 户注册实现
户注册第次登录网站户设计户成网站户前定注册访问网站网页
通三层架构模型实现户登录注册功里3逻辑层:表示层应逻辑层数层表示层负责接收前台页面数然传中间业务层业务层数进行处理处理数传数层然数库进行操作户信息存放数库中[15]户注册页面图62示
图62 户注册界面
注册页面部分代码:
public class UserAction extends ActionSupport
{
private int userId定义变量
private String userName
private String userPw
private String userRealname
private String userAddress
private String userSex
private String userTel
private String userEmail
private String userQq
private String newUserPw
private String message
private String path
private TUserDAO userDAO
public String userReg()
{
TUser usernew TUser()TUser 实体类
usersetUserName(userName)添加
usersetUserPw(userPw)
usersetUserAddress(userAddress)
usersetUserTel(userTel)
usersetUserRealname(userRealname)
usersetUserEmail(userEmail)
usersetUserSex(userSex)
usersetUserQq(userQq)
usersetUserDel(no)
userDAOsave(user)
Map session ServletActionContextgetContext()getSession()
sessionput(user user)
return successAdd
}public String userEdit()
{
TUser useruserDAOfindById(userId)
usersetUserName(userName)
usersetUserPw(userPw)
usersetUserAddress(userAddress)
usersetUserTel(userTel)
usersetUserRealname(userRealname)
usersetUserEmail(userEmail)
usersetUserSex(userSex)
usersetUserQq(userQq)
usersetUserDel(no)
userDAOattachDirty(user)
Map session ServletActionContextgetContext()getSession()
sessionput(user user)
return successAdd
}
63 订单信息模块设计
631 订单信息模块概述
户提交订单通产生订单号查询订单信息执行状态户预订中心首页中单击订单查询分类进入输入订单号页面页面文框中输入订单号单击提交钮果订单号输入误系统根户录入订单号数表中查询处应预订信息转订单查询显示页面预订信息显示出
632 订单信息模块实现
电影浏览模块页面图63示
图63查订单信息界面
查订单信息部分代码:
d save(TOrder transientInstance)
{
logdebug(saving TOrder instance)
try
{
getHibernateTemplate()save(transientInstance)
logdebug(save successful)
} catch (RuntimeException re)
{
logerror(save failed re)
throw re
}
}
public void delete(TOrder persistentInstance)
{
logdebug(deleting TOrder instance)
try
{
getHibernateTemplate()delete(persistentInstance)
logdebug(delete successful)
} catch (RuntimeException re)
{
logerror(delete failed re)
throw re
}
}
public TOrder findById(javalangInteger id)
{
logdebug(getting TOrder instance with id + id)
try
{
TOrder instance (TOrder) getHibernateTemplate()get(
commodelTOrder id)
return instance
}
64 电影浏览模块设计
641 电影浏览模块概述
电影浏览模块功浏览理员更新电影该模块中户畅销电影信息特价电影信息新电影信息根需选择类电影进行
订票
642 电影浏览模块实现
电影浏览模块页面图64示
图64 电影浏览界面
选择电影界面部分代码:
public String goodsDetail()
{
Map request(Map)ServletActionContextgetContext()get(request)
TGoods goodsgoodsDAOfindById(goodsId)
requestput(goods goods)
return ActionSupportSUCCESS
}
public String goodsAllYesTejia()
{
Map request(Map)ServletActionContextgetContext()get(request)
String sqlfrom TGoods where goodsDel'no' and goodsIsnottejia'yes' order by goodsCatelogId
List goodsListgoodsDAOgetHibernateTemplate()find(sql)
requestput(goodsList goodsList)
return ActionSupportSUCCESS
}
public String goodsAllNoTejia()
{
Map request(Map)ServletActionContextgetContext()get(request)
String sqlfrom TGoods where goodsDel'no' and goodsIsnottejia'no' order by goodsCatelogId
List goodsListgoodsDAOgetHibernateTemplate()find(sql)
requestput(goodsList goodsList)
65 台登陆设计
651 台登陆概述
前台首页单击理员入口转理员登录页面该页面功理员身份进行验证理登录页面中通JavaScript实现录入数完整性验证户输入登录ID密码单击登录钮时果录入数完整性验证通系统会数提交登录页面
652 台登陆实现
台登陆页面图65示
图65台登陆界面
台登陆界面部分代码:
String resultno
if(userType0)系统理员登陆
{
String sqlfrom TAdmin where userName and userPw
Object[] con{userNameuserPw}
List adminListadminDAOgetHibernateTemplate()find(sqlcon)
if(adminListsize()0)
{
resultno
}
else
{
WebContext ctx WebContextFactoryget()
HttpSession sessionctxgetSession()
TAdmin admin(TAdmin)adminListget(0)
sessionsetAttribute(userType 0)
sessionsetAttribute(admin admin)
resultyes
}
}
if(userType1)
{
}
if(userType2)
{
}
return result
}
66 台首页设计
661 台首页概述
台功允许具理员权限户实现前台功基础台包括理员身份验证添加电影信息模块订单信息理模块查询户信息理模块添加分类模块公告信息理模块台首页部分
(1)台导航区:放置理员操作项目分类
(2)操作区:显示台导航分类信息
662 台首页实现
方便理员理系统台首页中显示理员操作画面页面图65示
图66 台首页界面
台首页界面代码:
public List findByGoodsName(Object goodsName)
{
return findByProperty(GOODS_NAME goodsName)
}
public List findByGoodsMiaoshu(Object goodsMiaoshu)
{
return findByProperty(GOODS_MIAOSHU goodsMiaoshu)
}
public List findByGoodsPic(Object goodsPic)
{
return findByProperty(GOODS_PIC goodsPic)
}
public List findByGoodsYanse(Object goodsYanse)
{
return findByProperty(GOODS_YANSE goodsYanse)
}
public List findByGoodsShichangjia(Object goodsShichangjia)
{
return findByProperty(GOODS_SHICHANGJIA goodsShichangjia)
}
public List findByGoodsTejia(Object goodsTejia)
{
return findByProperty(GOODS_TEJIA goodsTejia)
}
public List findByGoodsIsnottejia(Object goodsIsnottejia)
{
return findByProperty(GOODS_ISNOTTEJIA goodsIsnottejia)
}
public List findByGoodsIsnottuijian(Object goodsIsnottuijian)
{
return findByProperty(GOODS_ISNOTTUIJIAN goodsIsnottuijian)
}
public List findByGoodsCatelogId(Object goodsCatelogId)
{
return findByProperty(GOODS_CATELOG_ID goodsCatelogId)
}
public List findAll()
{
logdebug(finding all TGoods instances)
try
{
String queryString from TGoods
return getHibernateTemplate()find(queryString)
} catch (RuntimeException re)
{
logerror(find all failed re)
throw re
}
}
67 添加电影信息模块设计
671 添加电影信息模块概述
单击左面导航区中影票理分类系统开已存电影票基信息点击添加钮进入电影票添加操作界面该页面电影信息添加数库中提供前台首页电影展示需数
672 添加电影信息模块实现
方便理员理左面操作区采树形结构折叠功添加电影信息功里面找点击添加影票信息界面图65示
图67 添加电影信息界面
添加电影信息界面部分代码:
public String goodsNoTejiaAdd()
{
TGoods goodsnew TGoods()
goodssetGoodsCatelogId(goodsCatelogId)
goodssetGoodsName(goodsName)
goodssetGoodsMiaoshu(goodsMiaoshu)
goodssetGoodsPic(fujian)
goodssetGoodsShichangjia(goodsShichangjia)
if(goodsTejia0)特格0表示没特价
{
goodssetGoodsTejia(goodsShichangjia) 果特价电影特价设置市场价格
goodssetGoodsIsnottejia(no)
}
else
{
goodssetGoodsTejia(goodsTejia)
goodssetGoodsIsnottejia(yes)
}
goodssetGoodsKucun(goodsKucun)
goodssetGoodsDel(no)
goodsDAOsave(goods)
thissetMessage(操作成功)
thissetPath(goodsManaNoTejiaaction)
return succeed
}
第7章 系统调试测试
71 系统测试原理原
软件测试时作期软件正式投入前关键步骤完美通性测试正式供户测试测试类性指标否达需求分析中达目标描述象性相关特性评价系统测试正常条件非正常条件控制操作参考操作结果程
正常测试会陷入误区找错误测试然果通分析错误分布产生原会相开发程软件提供良改良方案优化软件开发方法期开发完善测试方法改善测试效性
711 系统测试原理
测试试系统研制务书技术规格书软件雄体功性综合测试评估测试原理软件测试活动理基础测试方法铡试原理实际应获测试数手段基软件性软件测试遵循般软件测试原理方法时针软件特性必须找合适测试方法
测试例合理性软件测试评估具关键作设计例合理典型效容易应该软件研制员终户起针性研究实际操作环境加描述形成合理测试例集方面软件运行环境复杂程度软件评估具重作应产生量逼真运行背景便研究
712 系统测试原
序员应避免测试编写程序测试例设计必须包括预期输出结果测试例应包括效期输入情况包括效期输入情况测试应追溯户需求测试活动应该计划计划够保障检查程序否做应该做事仅完成测试工作半半检查程序否做该做事段程序中存错误概率段程序中已发现错误数成例测试作必须明确目标早断进行软件测试穷举测试充分覆盖程序逻辑
72 影院订票系统测试
网站系统实现功户注册登陆浏览电影票预订信息户预订填写订单理员网站信息方面操作维护等根面介绍测试原测试例文档分系统进行测试测试部分包括网站数库访问更新测试网站查询功测试系统容错功测试
73 调试程调试结果分析
731登陆功测试
系统运行出现登陆界面选择进入台输入设定账号:huangyan然输入错误密码:1111会弹出提示:户密码错误输入正确密码:huangyan进入台界面会员登陆输入错误密码会弹出提示:户名密码错误
图71 理员登陆错误界面
图72 户登陆错误界面
732 理员理功测试
台理员影票进行增加修改时电影类进行增加删删类底电影情况系统会弹出提示框:请删类影片图73示
图73 删类错误界面
第8章 总结
着毕业日子毕业设计接尾声四月时间毕业设计影院订票系统设计实现终完成系统完成投入精力时收获验
系统名称定影院订票系统设计实现原喜欢电影生活中常接触影院订票系统中渐渐系统产生兴趣决定题目日常里常见影院订票系统包含相功系统具功户注册登录购票专区订单查询资料修改添加电影信息查询户信息添加分类等毕业设计前根学知识软件开发理解仅仅局限编程觉软件开发单纯写程序通学期毕业设计计算机技术更深步理解深刻认识程序开发仅仅编程前面需需求分析概设计详细设计等重程程序开完完成需进行软件测试工作根查阅资料知道想完成毕设影院订票系统必须完成步骤市场调研计划分析设计编码测试首先浏览型网站解影院订票网站包含功然布置电脑环境选择开发工具MyEclipse90SQL Server 2008Tomcat60
毕业设计影院订票系统然已完成时系统满意方感觉感遗憾点设想系统功时希添加项客户订票时候喜挑选座位幸力足愿终没成功希工作生活中会断充实知识更强
参考文献
[1] 明日科技编 Java入门精通[M] 北京 清华学出版社 20124647
[2] Amir Albadvi Ghazaleh Saddad Journal of Hospitality Marketing & Management[J] Lulea University of Technology 2011 21(02) 155183
[3] Yi Liu Juliana Sutanto Electronic Markets[J] ETH Zurich 2012 (02) 8393
[4] 崔强 电子影票系统总体设计构想[J] 中国电影科研 2011 (11) 4344
[5] 常建功 Java Web典型模块项目实战全[M] 北京 清华学出版社 2011 3233
[6] 林信良 JSP & Servlet学笔记[M] 北京 清华学出版社 201205 179180
[7] 李淼 网页设计中Bootstrap CSS框架应扩展[J] 电子技术软件工程 2013 (17) 222224
[8] 李慧云 震苇 HTML5技术应模式研究[J] 中国电信股份限公司广东研究院 2012 (5) 2529
[9] 赵姝菊 基Java Web项目开发JavaBean应探究[D] 电脑知识技术 201205 10941095
[10] 陈俊浩 基SQL Server数库安全机制研究分析[J] 信息通信 2015(4) 120121
[11] 张超 基JSP数库连接技术浅析[J] 福建电脑 2013 28(12) 8081
[12] 赵越 杨丹 王欣欣 票务网站设计构想[J] 首济贸易学密云分校计算机系 2011 (05) 2728
[13] 甘洁静 SQL数库建立理[J] 计算机光盘软件应 2012 (4) 109111
[14] 姜桂洪 SQL Server 2005数库开发应[M] 清华学出版社 2014 16
[15] 李玉荣 三层架构模式登录注册功设计实现[J] 濮阳职业技术学院 2015(4) 110111
致 谢
伴着毕设文收尾学四年生活结束通学期毕业设计计算机技术更深步理解深刻认识程序开发仅仅编程前面需需求分析概设计详细设计等重程程序开完完成需进行软件测试工作
毕业设计程中指导老师姜老师指导支持特感谢指导老师指导老师细心指导力支持总体结构功握予非常帮助时提供资料参考编程数库设计等细节工作予耐心指导利完成次毕业设计起关键性作
通阶段努力毕业文影院订票系统终完成学阶段学思想受益非浅身努力外位老师学朋友关心支持鼓励分开次表示深深感谢感谢母校——辽宁工业学学四年生活中予关心帮助老师学教会专业知识做道理通次毕业设计明白作名计算机专业学毕业生会仅仅编写代码更重整体握系统设计力会工作中断学断完善母校争光翻开辉煌新篇章
附 录
外文文献: Discussion on Optimization of database design
A database consists of a file or a set of files The information in these files may be broken down into records each of which consists of one or more fields Fields are the basic units of data storage and each field typically contains information pertaining to one aspect or attribute of the entity described by the database Using keywords and various sorting commands users can rapidly search rearrange group and select the fields in many records to retrieve or create reports on particular aggregates of data
Database records and files must be organized to allow retrieval of the information Early systems were arranged sequentially (ie alphabetically numerically or chronologically) the development of directaccess storage devices made possible random access to data via indexes Queries are the main way users retrieve database information Typically the user provides a string of characters and the computer searches the database for a corresponding sequence and provides the source materials in which those characters appear A user can request for example all records in which the content of the field for a person’s last name is the word Smith
In flat databases records are organized according to a simple list of entities many simple databases for personal computers are flat in structure The records in hierarchical databases are organized in a treelike structure with each level of records branching off into a set of smaller categories Unlike hierarchical databases which provide single links between sets of records at different levels network databases create multiple linkages between sets by placing links or pointers to one set of records in another the speed and versatility of network databases have led to their wide use in business
Relational databases are used where associations among files or records cannot be expressed by links a simple flat list becomes one table or relation and multiple relations can be mathematically associated to yield desired information Objectoriented databases store and manipulate more complex data structures called objects which are organized into hierarchical classes that may inherit properties from classes higher in the chain this database structure is the most flexible and adaptable
With the development of database technology people depend more and more on the business data to the computer But the traditional file data storage and retrieval methods are not flexible and based on difficult to manage and optimization design of database becomes the focus of concern Mass data how to effectively organize and process large database so that people can easily quickly and accurately the completion of the data access operations become the bottleneck of the construction and use of the database
The operation speed and efficiency is an important standard to measure the performance of database system in order to ensure the system performance and throughput need logical design and physical design of the database is optimized which runs through the database design from beginning to end this is the primary task of the database optimization design
This paper from the paradigm of optimization index optimization optimization and query optimization in four aspects of database optimization method design and carries on the analysis to their comprehensive use
1 paradigm optimization
Results the logical database design is not only good relationship model usually need to meet 2 conditions the correct expression data semantics and avoid data redundancy abnormal and inconsistent problems In the design process starting from the 2 basic conditions do not care for this and lose that so as to improve the performance of database in the correctness and ensure database
The paradigm was used to evaluate the relationship of quality standard model has some scientific Usually a relational schema to BCNF or 3NF is believed to have better performance When a relational schema to BCNF can effectively eliminate data redundancy and the abnormal phenomenon but sometimes not necessarily keep the original function relation model dependence destroy the data semantics So the design should be balanced first as far as possible the design into the BCNF mode set if not up to keep the function dependence reduce paradigm requires into 3NF mode set in order to ensure the correct expression data semantic pattern set
2 index optimization
The index is an important data structure in the database its fundamental purpose is to improve the query efficiency improve the performance of the system But the index storage and maintenance operations at the same time can give the system space and time brings some negative effects the system performance of sacrifice So the design should be chosen as the useful indexes to find the best balance between improving the inquiry speed and save the memory space
(1) in large relational databases if handled the relation table of small need not be indexed Because the amount of data is small direct scanning can be quickly to traverse the entire table indexed it will increase the burden on the system
(2) if the data is updated frequently the maintenance cost is greatly paid index if the price exceeds the benefits of this query the index is not desirable
(3) select the appropriate column is indexed to the balance of positive and negative index effect plays an important role in Usually have the following characteristics ① data column is indexed to define a primary key and foreign key columns of data the need in the specified range in the fast or frequent query column the need to sort order fast or frequent search column the need for rapid or frequent together is included in the collection process
If any of the following circumstances are not consider creating index [2] almost not involved in the columns in the query the different value of less column as in table student gender column only male and female 2 different values it is not necessary to establish index ③ consists of text image etc data type columns defined
(4) the index is clustered and nonclustered indexing consideration should be given to both the selection often as field sort query results conditions should be built for the clustered index For example the query results to age sort can establish a clustered index on the age field when in some fields for the query conditions large amounts of data need to return the local scope should be in the field to establish a clustered index while less query volume data obtained in this field it is necessary to establish a non clustered index Data such as return in a certain period of time can consider to build a clustered index on the date field ③ should establish a clustered index in the field content repetition larger and when the data uniqueness is higher for a field it is necessary to establish a non clustered index For example student achievement repeatability large may consider the establishment of the clustered index record field has no absolute bounds on the indexed column and the type of index selection in the practical application make a concrete analysis of the elements to reach the optimal performance system
3 query optimization
In all the operation of the database query operations account for a large proportion the query speed directly affects the life of application system so the query design more optimization plays an important role in improving the overall database performance Practice has proved semantic equivalence queries can be found in many cases and the choice of query different effects on the query efficiency greatly different especially in some largescale relational database application system Based on the examples the combination of database theory discusses the use of query optimization in real systems
In 3 as a student management system
(1) the student registration form (S SNO SNAME AGE name age sex or SEX SDEPT)
(2) registration form (SNO SC learning school course No CNO grade GRADE)
(3) course registration form C (CNO CNAME courses curriculum class teachers college CDEPT TNAME)
Optimization of 4 table
Logical database design based on the normalization theory put data into multiple related tables But with the increasing of the degree of standardization the query request number and complexity of connection table also increased coupled complex system will impact the overall performance In addition to some queries using a single query to obtain the query results is a difficult task especially for large database systems not easy to examine the results of the query the query to determine the correct or not very difficult In view of this situation to simplify the query by using temporary table
For example query a students in a course grade The use of high frequency of this query the establishment of a temporary table TEMPSC (Student ID (SNO) (SNAME) the name course name (CNAME) teachers (TNAME) score (GRADE)) and the S C and SC on the query results into table TEMPSC Subsequent query directly on the TEMPSC operation simplifies the query work
As with most girls name query system Using a single query is difficult to obtain the query results you can create temporary table TEMPW (College (SDEPT) number (NUMBER)) the statistical departments the number of girls write the results of this table then find out the largest number of department name in table TEMPW By decomposing the operating process the solution can be simplified
Use temporary tables to the attention of the update operation in order to maintain consistency between data and the original table After use should delete release the occupied space
In short the database design according to the specific circumstances of the above several aspects of the optimization strategy organically as far as possible to make the system to achieve optimal efficiency
译文:数库优化设计方法初探
数库文件文件集合组成文件中信息分解成记录记录域域数存储基单位域般含数库描述属实体方面特性信息户键盘种排序命令够快速查找重排分组查找许记录中选择相应域建立特定集报表
数库记录文件组织必须确保信息进行检索早期系统序组织(:字母序数字序时间序)直接访问存储设备研制成功通索引机访问数成户检索数库信息方法query(查询)通常情况户提供字符串计算机数库中寻找相应字符序列出字
符串处出现户够记录中寻找last name域Smith记录
非结构化数库中实体简单列表组织记录计算机简易数库非结构层次型数库树型组织记录层记录分解成更属性集层次型数库层记录集间提供单链接网络型数库记录集间提供链接通设置指记录集链指针实现网络型数库速度样性企业中广泛应
关系链表达时关系型数库表关系简单非结构列表关系通数学关系提供需信息面象数库存储处理更复杂称象数结构组织成层次类中类继承层次链中更高级类特性种数库结构灵活具适应性
着数库技术发展越越赖计算机化业务数传统基文件数存储检索方法灵活难理数库优化设计成关注问题效组织处理型数库海量数方便准确快捷完成数存取操作成数库建设瓶颈
运行速度执行效率衡量数库系统性重标准保证系统性吞吐量需数库逻辑设计物理设计进行优化贯穿数库设计始终数库优化设计首务
文范式优化索引优化表优化查询优化四方面探讨数库优化设计方法综合进行分析
范式优化
数库逻辑设计结果惟关系模式通常需满足2条件正确表达数语义避免数冗余异常致问题出现设计程中2基条件出发顾失彼样提高数库性时保证数库正确性
模式范式作评价关系模式优劣标准具定科学性通常关系模式达BCNF3NF时认具较性某关系模式达BCNF时效消数冗余异常现象时定保持原关系模式函数赖关系破坏数语义设计时应统筹兼顾先设计成BCNF模式集时达保持函数赖特点降低范式求改成3NF模式集保证模式集正确表达数语义
索引优化
索引数库中重数结构根目提高查询效率改善系统性索引存储维护操作时会系统空间时间带负面影响牺牲定系统性设计时应量选择索引提高查询速度节省存储空间间寻求佳衡点
(1)型关系数库中处理关系表较需建立索引数量较时直接扫描便快遍历整表建立索引反会加重系统负担
(2)果数更新较频繁维护索引付出代价种代价超出查询获处时索引取
(3)选择合适列建立索引衡索引正负面影响重作通常特性数列建立索引①定义键外键数列②需指定范围中快速频繁查询列③需排序序快速频繁检索列④集合程中需快速频繁组合起列
列情况时考虑创建索引[2]①查询中涉列②值少列学生表性列男女2值必建立索引③文图等数类型定义列
(4)索引分聚集索引非聚集索引建立索引时应考虑两者选择①常作查询结果排序条件字段应建聚集索引例查询结果年龄排序年龄字段建立聚集索引②某字段查询条件需回传局部范围量数时应字段建立聚集索引查询获数量较少时必字段建立非聚集索引例回传某时间段间数考虑日期字段建聚集索引③应容重复性较字段建立聚集索引某字段数惟性较高时必建立非聚集索引例学生成绩重复性较考虑成绩字段建立聚集索引索引列索引类型选择没绝界限实际应中综合素点具体分析达系统性综合优
查询优化
数库操作中查询操作占例查询速度快慢直接影响应系统生命力设计较优化查询语句提高数库整体性着重作实践证明许情况均找语义等价查询选择查询语句查询效率影响相尤规模关系数库应系统中更加明显文应实例基础结合数库理探讨查询优化技术现实系统中运
设某学生理系统中3关系
(1)学生登记表S(学号SNO姓名SNAME年龄AGE性SEX院系SDEPT)
(2)学登记表SC(学号SNO课程号CNO成绩GRADE)
(3)课程登记表C(课程号CNO课程名CNAME开课院系CDEPT教师TNAME)
表优化
数库逻辑设计时范化理数划分成相关表着规范化程度增加查询时求联接表数目复杂性增加系统复杂联接运算影响整体性外某查询求单查询语句获查询结果较困难工作特型数库系统容易检查查询结果确定查询正确否非常困难针情况通引入时表简化查询
例查询某学生某门课程成绩查询频率较高建立时表TEMPSC (学号(SNO)姓名(SNAME)课程名(CNAME)教师(TNAME)成绩(GRADE))表SCSC查询结果写入表TEMPSC中续查询时直接表TEMPSC操作简化查询工作
查询具女生系名称单条查询语句获查询结果较困难建立时表TEMPW (院系(SDEPT)数(NUMBER))先院系女生数统计结果写入表表TEMPW中查出数院系名称通分解操作程解决办法简化
时表时注意更新操作保持原始表间数致性完毕应删释放占空间
总数库设计时根具体情况述方面优化策略机结合起系统效率达优
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档