第15章 数据库应用结构与数据访问接口_2new

第15章 数据库应用结构与数据访问接口_2new

ID:34452454

大小:212.92 KB

页数:34页

时间:2019-03-06

第15章 数据库应用结构与数据访问接口_2new_第1页
第15章 数据库应用结构与数据访问接口_2new_第2页
第15章 数据库应用结构与数据访问接口_2new_第3页
第15章 数据库应用结构与数据访问接口_2new_第4页
第15章 数据库应用结构与数据访问接口_2new_第5页
资源描述:

《第15章 数据库应用结构与数据访问接口_2new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Chapter15DatabaseInterfaceChapter15-Objectives¢Introducetothemethodsofaccessdatabaseinapplications:¢EmbeddedSQL¢DatabaseInterface¢ODBC¢OLEDBandADO¢JDBCInteractivevs.Non-InteractiveSQL¢InteractiveSQL:SQLstatementsinputfromterminal;DBMSoutputstoscreen¢Inadequateformostuses¢Itmaybenecessarytop

2、rocessthedatabeforeoutput¢Amountofdatareturnednotknowninadvance¢SQLhasverylimitedexpressivepower¢Non-interactiveSQL:SQLstatementsareincludedinanapplicationprogramwritteninahostlanguage,likeC,Java,COBOLApplicationProgram¢HostlanguageHostlanguage:Aconventionallanguage(e.g.,C,Java)thatsupplies

3、controlstructures,computationalcapabilities,interactionwithphysicaldevices¢SQL:suppliesabilitytointeractwithdatabase.¢Usingthefacilitiesofboth:theapplicationprogramcanactasanintermediarybetweentheuserataterminalandtheDBMSIntroducingSQLIntotheApplication¢SQLstatementscanbeincorporatedintoana

4、pplicationprogramintwodifferentways:¢StatementLevelInterface(SLI):ApplicationprogramisamixtureofhostlanguagestatementsandSQLstatementsanddirectives(embeddedSQL).¢CallLevelInterface(CLI):Applicationprogramiswrittenentirelyinhostlanguage¢SQLstatementsarevaluesofstringvariablesthatarepassedasa

5、rgumentstohostlanguage(library)proceduresStatementLevelInterface¢SQLstatementsanddirectives(embeddedSQL)intheapplicationhaveaspecialsyntaxthatsetsthemofffromhostlanguageconstructs¢e.g.,EXECSQLSQL_statement¢PrecompilerscansprogramandtranslatesSQLstatementsintocallstohostlanguagelibraryproced

6、uresthatcommunicatewithDBMS¢HostlanguagecompilerthencompilesprogramCallLevelInterface¢Applicationprogramwrittenentirelyinhostlanguage(noprecompiler)¢Examples:JDBC,ODBC,OLEDB,ADO,ADO.NET¢SQLstatementsarevaluesofstringvariablesconstructedatruntimeusinghostlanguage¢SimilartodynamicSQL¢Applicat

7、ionusesstringvariablesasargumentsoflibraryroutinesthatcommunicatewithDBMS¢e.g.executeQuery(“SQLquerystatement”)EmbeddedSQLEXECSQLBEGINDECLARESECTION;unsignedlongnum_enrolled;charcrs_code;charSQLSTATE[6];VariablessharedbyEXECSQLENDDECLARESECTION;hostandSQ

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

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

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