版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、山西大學(xué)本科畢業(yè)論文(設(shè)計(jì))外文翻譯資料外文出處:exploiting software how to break codeby greg hoglund, gary mcgraw publisher : addison wesley pub date : february 17, 2004 isbn : 0-201-78695-8譯文標(biāo)題:jdbc接口技術(shù) 譯文: jdbc是一種可用于執(zhí)行sql語(yǔ)句的javaapi(applicationprogramminginterface應(yīng)用程序設(shè)計(jì)接口)。它由一些java語(yǔ)言編寫(xiě)的類和界面組成。jdbc為數(shù)據(jù)庫(kù)應(yīng)用開(kāi)發(fā)人員、數(shù)據(jù)庫(kù)前臺(tái)工具開(kāi)發(fā)人員提供
2、了一種標(biāo)準(zhǔn)的應(yīng)用程序設(shè)計(jì)接口,使開(kāi)發(fā)人員可以用純java語(yǔ)言編寫(xiě)完整的數(shù)據(jù)庫(kù)應(yīng)用程序。 一、odbc到j(luò)dbc的發(fā)展歷程 說(shuō)到j(luò)dbc,很容易讓人聯(lián)想到另一個(gè)十分熟悉的字眼“odbc”。它們之間有沒(méi)有聯(lián)系呢?如果有,那么它們之間又是怎樣的關(guān)系呢? odbc是opendatabaseconnectivity的英文簡(jiǎn)寫(xiě)。它是一種用來(lái)在相關(guān)或不相關(guān)的數(shù)據(jù)庫(kù)管理系統(tǒng)(dbms)中存取數(shù)據(jù)的,用c語(yǔ)言實(shí)現(xiàn)的,標(biāo)準(zhǔn)應(yīng)用程序數(shù)據(jù)接口。通過(guò)odbcapi,應(yīng)用程序可以存取保存在多種不同數(shù)據(jù)庫(kù)管理系統(tǒng)(dbms)中的數(shù)據(jù),而不論每個(gè)dbms使用了何種數(shù)據(jù)存儲(chǔ)格式和編程接口。 1odbc的結(jié)構(gòu)模型 odbc的結(jié)構(gòu)
3、包括四個(gè)主要部分:應(yīng)用程序接口、驅(qū)動(dòng)器管理器、數(shù)據(jù)庫(kù)驅(qū)動(dòng)器和數(shù)據(jù)源。 應(yīng)用程序接口:屏蔽不同的odbc數(shù)據(jù)庫(kù)驅(qū)動(dòng)器之間函數(shù)調(diào)用的差別,為用戶提供統(tǒng)一的sql編程接口。 驅(qū)動(dòng)器管理器:為應(yīng)用程序裝載數(shù)據(jù)庫(kù)驅(qū)動(dòng)器。 數(shù)據(jù)庫(kù)驅(qū)動(dòng)器:實(shí)現(xiàn)odbc的函數(shù)調(diào)用,提供對(duì)特定數(shù)據(jù)源的sql請(qǐng)求。如果需要,數(shù)據(jù)庫(kù)驅(qū)動(dòng)器將修改應(yīng)用程序的請(qǐng)求,使得請(qǐng)求符合相關(guān)的dbms所支持的文法。 數(shù)據(jù)源:由用戶想要存取的數(shù)據(jù)以及與它相關(guān)的操作系統(tǒng)、dbms和用于訪問(wèn)dbms的網(wǎng)絡(luò)平臺(tái)組成。 雖然odbc驅(qū)動(dòng)器管理器的主要目的是加載數(shù)據(jù)庫(kù)驅(qū)動(dòng)器,以便odbc函數(shù)調(diào)用,但是數(shù)據(jù)庫(kù)驅(qū)動(dòng)器本身也執(zhí)行odbc函數(shù)調(diào)用,并與數(shù)據(jù)庫(kù)相互配合
4、。因此當(dāng)應(yīng)用系統(tǒng)發(fā)出調(diào)用與數(shù)據(jù)源進(jìn)行連接時(shí),數(shù)據(jù)庫(kù)驅(qū)動(dòng)器能管理通信協(xié)議。當(dāng)建立起與數(shù)據(jù)源的連接時(shí),數(shù)據(jù)庫(kù)驅(qū)動(dòng)器便能處理應(yīng)用系統(tǒng)向dbms發(fā)出的請(qǐng)求,對(duì)分析或發(fā)自數(shù)據(jù)源的設(shè)計(jì)進(jìn)行必要的翻譯,并將結(jié)果返回給應(yīng)用系統(tǒng)。 2jdbc的誕生 自從java語(yǔ)言于1995年5月正式公布以來(lái),java風(fēng)靡全球。出現(xiàn)大量的用java語(yǔ)言編寫(xiě)的程序,其中也包括數(shù)據(jù)庫(kù)應(yīng)用程序。由于沒(méi)有一個(gè)java語(yǔ)言的api,編程人員不得不在java程序中加入c語(yǔ)言的odbc函數(shù)調(diào)用。這就使很多java的優(yōu)秀特性無(wú)法充分發(fā)揮,比如平臺(tái)無(wú)關(guān)性、面向?qū)ο筇匦缘取kS著越來(lái)越多的編程人員對(duì)java語(yǔ)言的日益喜愛(ài),越來(lái)越多的公司在java程
5、序開(kāi)發(fā)上投入的精力日益增加,對(duì)java語(yǔ)言接口的訪問(wèn)數(shù)據(jù)庫(kù)的api的要求越來(lái)越強(qiáng)烈。也由于odbc的有其不足之處,比如它并不容易使用,沒(méi)有面向?qū)ο蟮奶匦缘鹊龋瑂un公司決定開(kāi)發(fā)一java語(yǔ)言為接口的數(shù)據(jù)庫(kù)應(yīng)用程序開(kāi)發(fā)接口。在jdk1x版本中,jdbc只是一個(gè)可選部件,到了jdk11公布時(shí),sql類包(也就是jdbcapi)就成為java語(yǔ)言的標(biāo)準(zhǔn)部件。 二、jdbc技術(shù)概述 jdbc是一種可用于執(zhí)行sql語(yǔ)句的javaapi(applicationprogramminginterface,應(yīng)用程序設(shè)計(jì)接口)。它由一些java語(yǔ)言寫(xiě)的類、界面組成。jdbc給數(shù)據(jù)庫(kù)應(yīng)用開(kāi)發(fā)人員、數(shù)據(jù)庫(kù)前臺(tái)工具開(kāi)發(fā)
6、人員提供了一種標(biāo)準(zhǔn)的應(yīng)用程序設(shè)計(jì)接口,使開(kāi)發(fā)人員可以用純java語(yǔ)言編寫(xiě)完整的數(shù)據(jù)庫(kù)應(yīng)用程序。 通過(guò)使用jdbc,開(kāi)發(fā)人員可以很方便地將sql語(yǔ)句傳送給幾乎任何一種數(shù)據(jù)庫(kù)。也就是說(shuō),開(kāi)發(fā)人員可以不必寫(xiě)一個(gè)程序訪問(wèn)sybase,寫(xiě)另一個(gè)程序訪問(wèn)oracle,再寫(xiě)一個(gè)程序訪問(wèn)microsoft的sqlserver。用jdbc寫(xiě)的程序能夠自動(dòng)地將sql語(yǔ)句傳送給相應(yīng)的數(shù)據(jù)庫(kù)管理系統(tǒng)(dbms)。不但如此,使用java編寫(xiě)的應(yīng)用程序可以在任何支持java的平臺(tái)上運(yùn)行,不必在不同的平臺(tái)上編寫(xiě)不同的應(yīng)用。java和jdbc的結(jié)合可以讓開(kāi)發(fā)人員在開(kāi)發(fā)數(shù)據(jù)庫(kù)應(yīng)用時(shí)真正實(shí)現(xiàn)“writeonce,runevery
7、where!” java具有健壯、安全、易用等特性,而且支持自動(dòng)網(wǎng)上下載,本質(zhì)上是一種很好的數(shù)據(jù)庫(kù)應(yīng)用的編程語(yǔ)言。它所需要的是java應(yīng)用如何同各種各樣的數(shù)據(jù)庫(kù)連接,jdbc正是實(shí)現(xiàn)這種連接的關(guān)鍵。 jdbc擴(kuò)展了java的能力,如使用java和jdbcapi就可以公布一個(gè)web頁(yè),頁(yè)中帶有能訪問(wèn)遠(yuǎn)端數(shù)據(jù)庫(kù)的applet?;蛘咂髽I(yè)可以通過(guò)jdbc讓全部的職工(他們可以使用不同的操作系統(tǒng),如windwos,machintosh和unix)在intranet上連接到幾個(gè)全球數(shù)據(jù)庫(kù)上,而這幾個(gè)全球數(shù)據(jù)庫(kù)可以是不相同的。隨著越來(lái)越多的程序開(kāi)發(fā)人員使用java語(yǔ)言,對(duì)java訪問(wèn)數(shù)據(jù)庫(kù)易操作性的需求越來(lái)
8、越強(qiáng)烈。 mis管理人員喜歡java和jdbc,因?yàn)檫@樣可以更容易經(jīng)濟(jì)地公布信息。各種已經(jīng)安裝在數(shù)據(jù)庫(kù)中的事務(wù)處理都將繼續(xù)正常運(yùn)行,甚至這些事務(wù)處理是存儲(chǔ)在不同的數(shù)據(jù)庫(kù)管理系統(tǒng)中;而對(duì)新的數(shù)據(jù)庫(kù)應(yīng)用來(lái)說(shuō),開(kāi)發(fā)時(shí)間將縮短,安裝和版本升級(jí)將大大簡(jiǎn)化。程序員可以編寫(xiě)或改寫(xiě)一個(gè)程序,然后將它放在服務(wù)器上,而每個(gè)用戶都可以訪問(wèn)服務(wù)器得到最新的版本。對(duì)于信息服務(wù)行業(yè),java和jdbc提供了一種很好的向外界用戶更新信息的方法。 1jdbc的任務(wù) 簡(jiǎn)單地說(shuō),jdbc能完成下列三件事: 1)同一個(gè)數(shù)據(jù)庫(kù)建立連接; 2)向數(shù)據(jù)庫(kù)發(fā)送sql語(yǔ)句; 3)處理數(shù)據(jù)庫(kù)返回的結(jié)果。 2jdbc一種底層的api jdbc是
9、一種底層api,這意味著它將直接調(diào)用sql命令。jdbc完全勝任這個(gè)任務(wù),而且比其他數(shù)據(jù)庫(kù)互聯(lián)更加容易實(shí)現(xiàn)。同時(shí)它也是構(gòu)造高層api和數(shù)據(jù)庫(kù)開(kāi)發(fā)工具的基礎(chǔ)。高層api和數(shù)據(jù)庫(kù)開(kāi)發(fā)工具應(yīng)該是用戶界面更加友好,使用更加方便,更易于理解的。但所有這樣的api將最終被翻譯為象jdbc這樣的底層api。目前兩種基于jdbc的高層api正處在開(kāi)發(fā)階段。 1)sql語(yǔ)言嵌入java的預(yù)處理器。雖然dbms已經(jīng)實(shí)現(xiàn)了sql查詢,但jdbc要求sql語(yǔ)句被當(dāng)作字符串參數(shù)傳送給java程序。而嵌入式sql預(yù)處理器允許程序員將sql語(yǔ)句混用:java變量可以在sql語(yǔ)句中使用,來(lái)接收或提供數(shù)值。然后sql的預(yù)處理器
10、將把這種javasql混用的程序翻譯成帶有jdbcapi的java程序。 2)實(shí)現(xiàn)從關(guān)系數(shù)據(jù)庫(kù)到j(luò)ava類的直接映射。javasoft和其他公司已經(jīng)宣布要實(shí)現(xiàn)這一技術(shù)。在這種“對(duì)象關(guān)系”映射中,表的每一行都將變成這類的一個(gè)實(shí)例,每一列的值對(duì)應(yīng)實(shí)例的一個(gè)屬性。程序員可以直接操作java的對(duì)象;而存取所需要的sql調(diào)用將在內(nèi)部直接產(chǎn)生。還可以實(shí)現(xiàn)更加復(fù)雜的映射,比如多張表的行在一個(gè)java的類中實(shí)現(xiàn)。 隨著大家對(duì)jdbc興趣的不斷濃厚,越來(lái)越多的開(kāi)發(fā)人員已經(jīng)開(kāi)始利用jdbc為基礎(chǔ)的工具進(jìn)行開(kāi)發(fā)。這使開(kāi)發(fā)工作變得容易。同時(shí),程序員也正在開(kāi)發(fā)對(duì)最終用戶來(lái)說(shuō)訪問(wèn)數(shù)據(jù)庫(kù)更加容易的應(yīng)用程序。 3jdbc和o
11、dbc及其他api的比較 到目前為止,微軟的odbc可能是用得最廣泛的訪問(wèn)關(guān)系數(shù)據(jù)庫(kù)的api。它提供了連接幾乎任何一種平臺(tái)、任何一種數(shù)據(jù)庫(kù)的能力。那么,為什么不直接從java中直接使用odbc呢? 回答是可以從java中使用odbc,但最好在jdbc的協(xié)助下,用jdbcodbc橋接器實(shí)現(xiàn)。那么,為什么需要jdbc呢?要回答這個(gè)問(wèn)題,有這么幾個(gè)方面: 1)odbc并不適合在java中直接使用。odbc是一個(gè)c語(yǔ)言實(shí)現(xiàn)的api,從java程序調(diào)用本地的c程序會(huì)帶來(lái)一系列類似安全性、完整性、健壯性的缺點(diǎn)。 2)其次,完全精確地實(shí)現(xiàn)從c代碼odbc到j(luò)avaapi寫(xiě)的odbc的翻譯也并不令人滿意。比如
12、,java沒(méi)有指針,而odbc中大量地使用了指針,包括極易出錯(cuò)的空指針“void”。因此,對(duì)java程序員來(lái)說(shuō),把jdbc設(shè)想成將odbc轉(zhuǎn)換成面向?qū)ο蟮腶pi是很自然的。 3)odbc并不容易學(xué)習(xí),它將簡(jiǎn)單特性和復(fù)雜特性混雜在一起,甚至對(duì)非常簡(jiǎn)單的查詢都有復(fù)雜的選項(xiàng)。而jdbc剛好相反,它保持了簡(jiǎn)單事物的簡(jiǎn)單性,但又允許復(fù)雜的特性。 4)jdbc這樣的javaapi對(duì)于純java方案來(lái)說(shuō)是必須的。當(dāng)使用odbc時(shí),人們必須在每一臺(tái)客戶機(jī)上安裝odbc驅(qū)動(dòng)器和驅(qū)動(dòng)管理器。如果jdbc驅(qū)動(dòng)器是完全用java語(yǔ)言實(shí)現(xiàn)的話,那么jdbc的代碼就可以自動(dòng)的下載和安裝,并保證其安全性,而且,這將適應(yīng)任何
13、java平臺(tái),從網(wǎng)絡(luò)計(jì)算機(jī)nc到大型主機(jī)mainframe。 總而言之,jdbcapi是能體現(xiàn)sql最基本抽象概念的、最直接的java接口。它建構(gòu)在odbc的基礎(chǔ)上,因此,熟悉odbc的程序員將發(fā)現(xiàn)學(xué)習(xí)jdbc非常容易。jdbc保持了odbc的基本設(shè)計(jì)特征。實(shí)際上,這兩種接口都是基于xopensql的調(diào)用級(jí)接口(cli)。它們的最大的不同是jdbc是基于java的風(fēng)格和優(yōu)點(diǎn),并強(qiáng)化了java的風(fēng)格和優(yōu)點(diǎn)。 最近,微軟又推出了除了odbc以外的新的api,如rdo,ado和oledb。這些api事實(shí)上在很多方面上同jdbc一樣朝著相同的方向努力,也就是努力成為一個(gè)面向?qū)ο蟮?,基于odbc的類接口
14、。然而,這些接口目前并不能代替odbc,尤其在odbc驅(qū)動(dòng)器已經(jīng)在市場(chǎng)完全形成的時(shí)候,更重要的是它們只是odbc的“漂亮的包裝”。 4jdbc兩層模型和三層模型 jdbc支持兩層模型,也支持三層模型訪問(wèn)數(shù)據(jù)庫(kù)。 如圖所示,兩層模型中,一個(gè)java appple或者一個(gè)java應(yīng)用直接同數(shù)據(jù)庫(kù)連接。這就需要能直接被訪問(wèn)的數(shù)據(jù)庫(kù)進(jìn)行連接的jdbc驅(qū)動(dòng)器。用戶的sql語(yǔ)句被傳送給數(shù)據(jù)庫(kù),而這些語(yǔ)句執(zhí)行的結(jié)果將被傳回給用戶。數(shù)據(jù)庫(kù)可以在同一機(jī)器上,也可以另一機(jī)器上通過(guò)網(wǎng)絡(luò)進(jìn)行連接。這被稱為“client/server”結(jié)構(gòu),用戶的計(jì)算機(jī)作為client,運(yùn)行數(shù)據(jù)庫(kù)的計(jì)算機(jī)作為server。這個(gè)網(wǎng)絡(luò)可是
15、intranet,比如連接全體雇員的企業(yè)內(nèi)部網(wǎng),當(dāng)然也可以是internet。 如圖所示,在三層模型中,命令將被發(fā)送到服務(wù)的“中間層”,而“中間層”將sql語(yǔ)句發(fā)送到數(shù)據(jù)庫(kù)。數(shù)據(jù)庫(kù)處理sql語(yǔ)句并將結(jié)果返回“中間層”,然后“中間層”將它們 返回用戶。mis管理員將發(fā)現(xiàn)三層模型很有吸引力,因?yàn)椤爸虚g層”可以進(jìn)行對(duì)訪問(wèn)的控制并協(xié)同數(shù)據(jù)庫(kù)的更新,另一個(gè)優(yōu)勢(shì)就是如果有一個(gè)“中間層”用戶就可以使用一個(gè)易用的高層的api,這個(gè)api可以由“中間層”進(jìn)行轉(zhuǎn)換,轉(zhuǎn)換成底層的調(diào)用。而且,在許多情況下,三層模型可以提供更好的性能。 到目前為止,“中間層”通常還是用c或c+實(shí)現(xiàn),以保證其高性能。但隨著優(yōu)化編譯器的引
16、入,將java的字節(jié)碼轉(zhuǎn)換成高效的機(jī)器碼,用java來(lái)實(shí)現(xiàn)“中間層”將越來(lái)越實(shí)際。而jdbc是允許從一個(gè)java“中間層”訪問(wèn)數(shù)據(jù)庫(kù)的關(guān)鍵。指導(dǎo)教師評(píng)語(yǔ): 簽字: 年 月 日jdbc interface technology jdbc is a sql statement can be used for the implementation of the javaapi (applicationprogramminginterface application programming interface). it consists of a number of java language cla
17、ss and interface components. jdbc for database application developers, database developers front desk tools provides a standard application programming interface, so that developers can use pure java language to prepare a complete database application. one, odbc to jdbc course of development speakin
18、g of jdbc, it is tempting to think of another very familiar with the word odbc. there is no contact between them then? if there is, then between them is what kind of relationship? odbc is the english abbreviation opendatabaseconnectivity. it is a used in related or not related to database management
19、 system (dbms) to access data and implementation using c language, the standard application data interface.通過(guò)odbcapi, applications can access the stored in a variety of database management system (dbms) data, regardless of what the use of each dbms data storage format and programming interface. 1. o
20、dbc structural model odbc structure includes four main parts: application program interface, the drive manager, database driver and data source. application programming interface: shielded different odbc database drivers the difference between the function call to provide users with a unified sql pr
21、ogramming interface. driver manager: in order to load the database application drives. database drive: implementation of the odbc function calls to provide data source specific sql request. if necessary, the database driver will be requested to amend application order to make the request in accordan
22、ce with the relevant dbms supported by the grammar. data source: by the user wants to access the data, as well as with its associated operating system, dbms and the dbms used to access the network platform. although the odbc driver manager the main purpose of the database are loaded drive in order t
23、o odbc function call, but the database itself drive the implementation of odbc functions call, and with the database each other. thus, when the calling application systems and data sources to connect, the database driver can manage communications protocol. when set up with data source connectivity,
24、database-driven application system is able to handle the request sent to the dbms of analysis or data source from the bottom of the design of the necessary translation, and the results back to the applications. 2. jdbc birth since the java language in may 1995 has been officially announced, java swe
25、pt the world. emergence of many languages with java program, including the database should be procedure. because of absence of a java language api, the programmer has to program in java language odbc add c function call. this makes java a lot of outstanding unable to give full play to the characteri
26、stics, such as platform independence, object-oriented characteristics. as more and more programmers to the java language increasingly popular, more and more public secretary for program development in java on the increasing energy input on the java language interface to access the database of the ap
27、i requirements become stronger and stronger. also because of the odbc has its shortcomings the department, such as it is not easy to use, there is no object-oriented.features and so on, sun one company decided to develop java language database interface application development interface. at jdk1. x
28、version, jdbc is an optional component to thejdk1.1announcement, sql-type package (that is, jdbcapi) has become the standard java language, the department of pieces. second, jdbc technical overview jdbc is a sql statement can be used for the implementation of the javaapi (applicationprogramminginter
29、face, application programming interface). it consists of a number of writing java language class, interface components. jdbc for database application developers, database developers front desk tools provides a standard application programming access the mouth, so that developers can use pure java la
30、nguage to prepare a complete database application. through the use of jdbc, developers can easily send sql statements to virtually any kind of database. in other words, developers do not have to write a program access sybase, write another program to visit oracle, write a program to visit microsofts
31、 sqlserver. writing with jdbc procedures can automatically sql statement sent to the appropriate database management system (dbms). not only that, the use of java applications can be prepared at any support running on java platform, not must in the preparation of different platforms on different app
32、lications. the combination of java and jdbc allows developers to develop database applications really achieve writeonce, runeverywhere! java has a robust, secure, easy-to-use and other characteristics, but also support the automatic downloading, in essence, is a good database application programming
33、 language. it needs java application is how to work with various database connection, jdbc is the key to achieve this connection. jdbc expanded the ability of java, such as the use of java and jdbcapi can publish a web page, page with access to remote databases ap plet. either enterprises through jd
34、bc to allow all the workers (who can use different operating systems, such as windwos, machintosh and unix) at in tranet up to connect to the on a number of global databases, which can be several global databases are not identical. as more and more developers use java language, java access to data t
35、reasury ease the demand for more and more strongly. mis managers like java and jdbc, as it can more easily publish information economically. variety has been installed in the database of affairs will continue to deal with normal operation, and even deal with these matters are stored in different dat
36、abase management systems; and the new database application, the development time will be shortened, installation and version this upgrade will be greatly simplified. programmers can write or rewrite a program, and then put it on the server, each user can access the server to beup-to-date version. fo
37、r the information service industry, java and jdbc provides a good user to update information to the outside world approach. 1. jdbc-mission easy to say, jdbc can complete the following three things: 1) set up with a database connection; 2) send sql statements to the database; 3) deal with the result
38、s of the database back. 2. jdbc-an underlying api jdbc is an underlying api, which means that it will direct calls to sql commands. jdbc fully qualified for this mission, but also than other database connectivity is more easily now. it is also constructed at the same time high-level api and database
39、 development tools. high-level api and database development tools should be more friendly user interface, the use of more side then, more easily understandable. however, all this api will eventually be translated into jdbc such as the bottom of api. at present, two high-level api based on jdbc is in
40、development stage paragraph. 1) sql language embedded java pre-processor. while the dbms has achieved the sql query, but the jdbc requirements of sql statements as a string parameter transmitted to the java way sequence. the embedded sql preprocessor allows a programmer to mix sql statements: java v
41、ariables can be used in sql statements to receive or provide the value. and the pre-sql this processor will be java / sql mix procedures translated into the java program with jdbcapi. 2) implementation from the relational database to the java type of direct mapping. javasoft and other companies have
42、 announced plans to achieve this technology. at this object / relational mapping table of each line will become an example of this type, each column corresponds to the value of a property instance. java programmers can directly operate the object; and depositors check required by the sql call to be
43、a direct consequence of in-house. can also achieve more complex mapping, such as tables of many firms of a java implementation of the class. with the u.s. on the continuing strong interest in jdbc, a growing number of developers have begun to use jdbc-based tools for development. this development wo
44、rk has become easy. at the same time, programmers are also being developed for end-users easier access to the database applications. 3. jdbc and odbc, and other api comparison so far, microsofts odbc may be the most widely used relational database access api. it provides a connection to almost any p
45、latform, any one of a few according to the ability of the treasury. well, why not directly from java directly using odbc it? the answer is available from java using odbc, but preferably by the help of jdbc, using jdbc-odbc bridge implementation. so why does jdbc necessary? to return answer this ques
46、tion, there are so few aspects: 1) odbc is not suitable for direct use in java. odbc is a c language implementation of the api, from java program to call the local c procedure will bring about a series of similar security wide, integrity, robustness shortcomings. 2) secondly, completely accurate imp
47、lementation odbc from c code to the odbc writing javaapi translation is also not satisfactory. for instance, java no pointer, and odbc medium substantial use of indicators, including the highly error null pointer void *. thus, java programmers, the idea put jdbc to odbc converted into object-oriente
48、d the api is very natural. 3) odbc is not easy to study, it features easy and complex characteristics of mixed together, even for very simple query options are complex. the jdbc just instead, it has maintained a simple and easy things, but the characteristics of the complex permit. 4) jdbc such java
49、api for pure java programs are necessary. when using odbc, people must be on each client machine to install odbc drivers and driver manager. if the jdbc driver to use java language are fully realize, then the jdbc code can be automatically downloaded and installed, and to ensure their safety, moreov
50、er, this will adapt to any java platform, from the nc network computer to the mainframe mainframe. all in all, jdbcapi are able to embody the most basic abstraction of sql, the most direct java interface. it is the foundation to build on in the odbc, therefore, familiar with the odbc jdbc programmer
51、s will find very easy to study. jdbc has maintained the basic design features of odbc. in fact, these two interfaces are based on x / opensql the call-level access i (cli). their biggest difference is that jdbc is based on the style and the advantages of java and java has strengthened the style and
52、advantages. recently, microsoft also launched odbc except outside the new api, such as rdo, ado and oledb. these api in fact in many ways, like moving on with the jdbc-phase the same direction, which is striving to become an object-oriented, based on the type of odbc interface. however, these interfaces is currently no substitute for odbc, particularly in the odbc drive has been in the market, when fully formed, more importantly, they are only odbcs beautiful packaging. 4. jdbc two-tier model and the three-tier model jdbc support for a two
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 描寫(xiě)秋景的初一作文600字5篇
- 初中物理教學(xué)心得體會(huì)
- 大學(xué)畢業(yè)求職信合集五篇
- 對(duì)創(chuàng)業(yè)的認(rèn)識(shí)和理解范文五篇
- 七年級(jí)下冊(cè)歷史知識(shí)要點(diǎn)歸納總結(jié)
- 光電技術(shù)轉(zhuǎn)讓協(xié)議書(shū)(2篇)
- 租賃經(jīng)營(yíng)合同范本
- 旅游汽車(chē)租賃合同樣書(shū)
- 2025電腦購(gòu)銷合同合同范本
- 2025煤炭買(mǎi)賣(mài)合同
- 國(guó)家開(kāi)放大學(xué)電大《美學(xué)原理》形考任務(wù)1-4試題和答案
- 現(xiàn)場(chǎng)生命急救知識(shí)與技能學(xué)習(xí)通期末考試答案2023年
- 《HSK標(biāo)準(zhǔn)教程3》第18課課件
- 清掃保潔及垃圾清運(yùn)承包合同
- 聯(lián)通公司集團(tuán)大客戶業(yè)務(wù)開(kāi)通項(xiàng)目管理實(shí)施細(xì)則(試行)
- 真空管太陽(yáng)能熱水工程解決方案
- 公路養(yǎng)護(hù)作業(yè)區(qū)安全設(shè)施布設(shè)規(guī)定詳細(xì)
- 棋牌室合伙人協(xié)議
- 教師個(gè)人履職工作總結(jié)一級(jí)教師
- 國(guó)開(kāi)電大本科《管理英語(yǔ)3》機(jī)考總題庫(kù)
- 初中英語(yǔ)中考專題訓(xùn)練閱讀理解-應(yīng)用文篇
評(píng)論
0/150
提交評(píng)論