数据库系统英第三版课件2012版 Database Systems(9).ppt

数据库系统英第三版课件2012版 Database Systems(9).ppt

ID:51969291

大小:194.00 KB

页数:20页

时间:2020-03-26

数据库系统英第三版课件2012版 Database Systems(9).ppt_第1页
数据库系统英第三版课件2012版 Database Systems(9).ppt_第2页
数据库系统英第三版课件2012版 Database Systems(9).ppt_第3页
数据库系统英第三版课件2012版 Database Systems(9).ppt_第4页
数据库系统英第三版课件2012版 Database Systems(9).ppt_第5页
资源描述:

《数据库系统英第三版课件2012版 Database Systems(9).ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、9SQLinaServerEnvironmentTheThree-TierArchitectureTheSQLEnvironmentTheSQL/Host-LanguageInterfaceStoredProceduresUsingaCall-LevelInterfaceJDBCPHP9SQLinaServerEnvironmentWehaveseenonlyhowSQLisusedatthegenericqueryinterface---anenvironmentwherewesitataterminala

2、ndaskqueriesofadatabase.Realityisalmostalwaysdifferent:conventionalprogramsinteractingwithSQL.9SQLinaServerEnvironmentCodeinaspecializedlanguageisstoredinthedatabaseitself(e.g.,PSM,PL/SQL).SQLstatementsareembeddedinahostlanguage(e.g.,C).Connectiontoolsareus

3、edtoallowaconventionallanguagetoaccessadatabase(e.g.,CLI,JDBC,PHP/DB).9.1TheThree-TierArchitectureAcommonenvironmentforusingadatabasehasthreetiersofprocessors:Webservers---talktotheuser.Applicationservers---executethebusinesslogic.Databaseservers---getwhatt

4、heappserversneedfromthedatabase.9.2TheSQLEnvironmentThedatabaseis,inmanyDB-accesslanguages,anenvironment.Databaseserversmaintainsomenumberofconnections,soappserverscanaskqueriesorperformmodifications.Theappserverissuesstatements:queriesandmodifications,usua

5、lly.9.2TheSQLEnvironmentEnvironmentConnectionStatement9.3TheSQL/Host-LanguageInterface宿主语言+嵌套SQL编译预处理宿主语言+函数调用函数库目标代码编译包含SQL语句的典型编程系统的框架如下:9.3TheSQL/Host-LanguageInterfaceThedifferenceofSQLandconventional(传统的)programminglanguage:SQLusestherelationaldatamode

6、l.Conventionalprogramminglanguagesuseadatamodelwithintegers,reals,characters,andsoon.impedancemismatch(匹配失衡)Howtomanipulatedatabasebyconventionalprogramminglanguages?connecttodatabase,buildasession.sendasequenceofSQLstatements,receiveanddealwiththeresult.cl

7、osethesession.9.3TheSQL/Host-LanguageInterfaceTheSQL/HostLanguageInterface:DeclareSharedVariables。EXECSQLBEGINDECLARESECTION;charstudioName[50],studioAddr[256];charSQLSTATE[6];EXECSQLENDDECLARESECTION;UseEmbedSQL。EXECSQLINSERTINTOStudio(name,address)VALUES(

8、:studioName,:studioAddr);UsePrecompilerstatement,EXECSQL。UseSQLSTATE。UseCursor(游标,光标)。9.3TheSQL/Host-LanguageInterface建立和使用游标的步骤:游标说明DECLARE<游标名>[SCROLL]CURSORFORSELECT…打开游标OPEN<游标名>推进FETCH{NEXT

9、PRIOR

10、

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。