【正文】
ser might have put into a shopping cart and left from a previous transaction ?What items are in stock, along with their price, description, and so on ?Orders that need to be fulfilled, orders that have been shipped, and items that have been backordered .Now, you could store all this information in a flat file on the server39。ll walk through this flow in detail, but for the moment, here are the major steps: 1. A request es in from a browser using the normal HTTP request format. 2. The Web server hands off the request to JSP. JSP looks at the filename and finds the appropriate JSP file. 3. The .jsp file is converted into a .java file, containing Java code that will create a class whose name is derived from the .jsp filename. 4. JSP then piles the .java file using javac to produce a .class file. Note that the two previous steps are skipped if a .class file already exists and is newer than the .jsp file. 5. An instance of the newly created class is instantiated and sent the _jspService message. 6. The new instance looks to see if there is already an instance of the object called user existing in the session object space for the currently connected user. If not, one is instantiated.7. As part of servicing , the user instance is called with the getUserName() method. 8. If the JSP processing requires access to information in a database, it uses JDBC to make the connection and handle the SQL requests.As you can see, a tremendous amount of power is available in the JSP world. Developers are free to write Web pages that look mostly like HTML, except where callouts to Java are required. But, at the same time, they are free to develop fully fleshedout objectoriented applications using all the features that Java can bring to bear. They also get all the benefits of servlets, including session persistence.Why Do We Need Databases?Well, one reason is so that Larry Ellison of Oracle can afford to keep himself on Prozac when he thinks about Bill Gates. A more serious answer is the same reason that drove man to first press a stick against a piece of wet mud: because it39。s just as possible to design bad Web sites in JSP as with any other technology. That39。而當(dāng)你使用開(kāi)源軟件,你發(fā)送一條消息,你的首要問(wèn)題是他們的特點(diǎn)和可靠性,如果出現(xiàn)錯(cuò)誤,沒(méi)有一個(gè)大公司提起訴訟。)為什么支持這項(xiàng)活動(dòng)是很好的?對(duì)于這個(gè)問(wèn)題的答案有兩點(diǎn):一個(gè)是技術(shù)的和一個(gè)政治的。沒(méi)有什么是更遠(yuǎn)離真理。開(kāi)放源碼軟件是根據(jù)多個(gè)公共許可證的編碼,往往是GNU通用公共許可證(GPL)的人免費(fèi)提供。而且,最好的是,您開(kāi)發(fā)的代碼將使用這個(gè)平臺(tái)很好地運(yùn)行使用iPlanet和Oracle或WebSphere和SQL Server。因此,你要回滾到事務(wù)開(kāi)始之前的狀態(tài)。 回滾可以在開(kāi)始做一系列交易之前在數(shù)據(jù)庫(kù)設(shè)置一個(gè)保存點(diǎn),并能要么回滾到原來(lái)的狀態(tài)或提交在結(jié)束時(shí)候的改變。同樣,如果它在PURCHASE理是作為參考,你就不能從表USER里刪除ID為3的用戶,MySQL的人們做了一個(gè)漂亮慷慨激昂的論點(diǎn)關(guān)于在各自的文檔進(jìn)行數(shù)據(jù)的完整性取決于外鍵是無(wú)論如何都是一個(gè)壞主意,但是說(shuō)服你的這種哲學(xué)的DBA是很可能淪為一個(gè)宗教辯論,此外,其他一些功能缺失,如子查詢和SELECT INTO。外鍵約束防止你創(chuàng)建數(shù)據(jù)不一致。所以,也許你想知道,有什么收獲?沒(méi)有得到什么,你在MySQL中,使人們把目光轉(zhuǎn)向到Oracle?那么,MySQL是一個(gè)不錯(cuò)的小程序包,但它缺少一些東西,不然會(huì)是不錯(cuò)的一個(gè)完美的世界。當(dāng)你添加這些項(xiàng)目的購(gòu)物清單,只有一個(gè)關(guān)系數(shù)據(jù)庫(kù)才會(huì)真正的影響工作效率。第一個(gè)也是最重要的原因是你使用的數(shù)據(jù)庫(kù)是有大量的數(shù)據(jù)在電子商務(wù)交易里,你必須記住并跟蹤:?一個(gè)用戶的姓名,地址,信用卡和其他信息以前進(jìn)入了一個(gè)注冊(cè)頁(yè)面?帽子的用戶可能把以前留下交易放進(jìn)購(gòu)物車(chē)?哪些物品有存貨,以及它們的價(jià)格,描述等等?訂單需要履行,訂單已發(fā)貨,并已待補(bǔ)物品。更嚴(yán)重的回答是相同的原因也就是駕駛?cè)讼劝聪箩槍?duì)一塊濕粘泥:因?yàn)榘咽虑橛浵聛?lái)是好的。開(kāi)發(fā)者可以自由編寫(xiě)大多數(shù)看起來(lái)像HTML的Web頁(yè)面,除非到Java標(biāo)注是要求最喜歡看的HTML。如果沒(méi)有,一個(gè)實(shí)例被實(shí)例化。.,包含Java代碼,將創(chuàng)建一個(gè)類(lèi)。其結(jié)果是JavaServer頁(yè)面(在微軟方面,結(jié)果是活動(dòng)服務(wù)器頁(yè)面)。 當(dāng)你編碼很多網(wǎng)頁(yè)時(shí),這種嵌入式是非常古老非??斓摹?Servlet還遭受一大問(wèn)題。此外,該servlet可以訪問(wèn)會(huì)話持久對(duì)象。JSP它本身就是從第一個(gè)靜態(tài)Web服務(wù)器開(kāi)始的一個(gè)沿路徑循序漸進(jìn)的步驟,通過(guò)CGI移動(dòng)功能的服務(wù)器,最后腳本功能的服務(wù)器的第一代。這些做法包括諸如SQL數(shù)據(jù)庫(kù)和基于UML設(shè)計(jì)的東西。通過(guò)JDBC(Java數(shù)據(jù)庫(kù)連接),開(kāi)發(fā)人員能夠與大多數(shù)商業(yè)數(shù)據(jù)庫(kù)如Oracle進(jìn)行溝通。. . . . .