訂單管理系統(tǒng)中英文對照外文翻譯文獻(xiàn)_第1頁
訂單管理系統(tǒng)中英文對照外文翻譯文獻(xiàn)_第2頁
訂單管理系統(tǒng)中英文對照外文翻譯文獻(xiàn)_第3頁
訂單管理系統(tǒng)中英文對照外文翻譯文獻(xiàn)_第4頁
訂單管理系統(tǒng)中英文對照外文翻譯文獻(xiàn)_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

中英文對照外文翻譯(文檔含英文原文和中文翻譯)MySQLandJSPWebapplicationsJSPdevelopersencounteruniqueproblemswhenbuildingwebapplicationsthatrequireintensedatabaseconnectivity.MySQLandJSPWebApplicationsaddressesthechallengesofbuildingdata-drivenapplicationsbasedontheJavaServerPagesdevelopmentmodel.MySQLandJSPWebApplicationsbeginswithanoverviewofthecoretechnologiesrequiredforJSPdatabasedevelopment--JavaServerPages,JDBC,andthedatabaseschema.ThebookthenoutlinesandpresentsanInternetcommerceapplicationthatdemonstratesconceptssuchasreceivingandprocessinguserinput,designingandimplementingbusinessrules,andbalancingtheuserloadontheserver.ThroughtheJDBC(JavaDataBaseConnector),thedevelopercancommunicatewithmostcommercialdatabases,suchasOracle.ThesolutionspresentedinMySQLandJSPWebApplicationscenterontheopensourcetoolsMySQLandTomcat,allowingthereaderanaffordablewaytotestapplicationsandexperimentwiththebook'sexamples.SoWhatIsJSPAllAbout?Ifyoumeettherequirementsmentioned,youshouldalreadyhaveaprettygoodideawhattheanswertothisquestionis.JSPisallaboutdoinghighlyobject-orientedWebsitesthatcanleverageallthebestpracticesofmodernsoftwareengineering.ThesepracticesincludethingssuchasSQLdatabasesandUML-baseddesign.Thisisn'ttosaythatJSPisacure-allandthatusingitwillautomaticallymakeyourWebsiteaparagonofengineeringart.It'sjustaspossibletodesignbadWebsitesinJSPaswithanyothertechnology.That'swhy,asyougothroughthetext,youwillseehowtoincorporatethebestpracticesandhowtoavoidthepitfallsofconveniencewhenprojectsgetstressful.JSPitselfisanevolutionarystepalongthepaththatstartedwiththefirststaticWebservers,movedthroughCGI-enabledservers,andfinallythefirstgenerationofscript-enabledservers.JSPislessaWebserverwithaJavacomponentthanitisaJavaenginethatunderstandstheWeb.JSPgrewoutofJavaservlets.ServletsallowthedevelopertohandletheincomingWebrequestsusingaJavaprogramthathasaccesstoallthenormalinformationthataCommonGatewayInterface(CGI)programwould.Inaddition,theservlethasaccesstosession-persistentobjects.TheseareJavaobjectsthatareassociatedwithaspecificusersessionandcanbeusedtostorestatebetweenrequests.Servletprogrammingwasamajorstepforwardinallowingdeveloperstowritewell-structuredmodularWebapplicationsusinganobject-orientedlanguage.Italsosolvedtheproblemofstatepersistence,allowingmoreinformationtoresideontheserverduringatransactionandlesstohavetopassbackandforthbetweentheuserandtheserver.Servletsstillsufferedfromonemajorproblem.BecausetheyeventuallyneedtospitoutHTML,theHTMLcodinghadtobeembeddedintheservletcode.Thisledtocodefragmentsliketheoneshownhere:Out.println("<HTML>\n<HEAD>\n<TITLE>ThankyouforRegistering</TITLE></HEAD>\n");Out.println("<IMGSRC=\"thanks.jpg\"WIDTH=200HEIGHT=100ALIGN=\"LEFT\”>");Thiskindofembeddinggetsveryoldveryfastwhenyouhavetocodealotofpages.Inaddition,havingtoescapeallofthequotationmarkscanleadtoalotofconfusingandhard-to-finderrorsifyouleaveoutabackslash.Eventually,astill-betterideaemerged.SupposethatyoucouldcombinethebestofstaticHTMLpagesandwiththeinteractivecapabilitiesofservlets.TheresultwasJavaServerPages(ontheMicrosoftside,theresultwasActiveServerPages).AsFigureI.1shows,JSPisacomplicatedbeast.Inthenextchapter,you'llwalkthroughthisflowindetail,butforthemoment,herearethemajorsteps:1.ArequestcomesinfromabrowserusingthenormalHTTPrequestformat.2.TheWebserverhandsofftherequesttoJSP.JSPlooksatthefilenameandfindstheappropriateJSPfile.3.The.jspfileisconvertedintoa.javafile,containingJavacodethatwillcreateaclasswhosenameisderivedfromthe.jspfilename.4.JSPthencompilesthe.javafileusingjavactoproducea.classfile.Notethatthetwopreviousstepsareskippedifa.classfilealreadyexistsandisnewerthanthe.jspfile.5.Aninstanceofthenewlycreatedclassisinstantiatedandsentthe_jspServicemessage.6.Thenewinstancelookstoseeifthereisalreadyaninstanceofthestuff.Userobjectcalleduserexistinginthesessionobjectspaceforthecurrentlyconnecteduser.Ifnot,oneisinstantiated.7.Aspartofservicingstuff.jsp,theuserinstanceiscalledwiththegetUserName()method.8.IftheJSPprocessingrequiresaccesstoinformationinadatabase,itusesJDBCtomaketheconnectionandhandletheSQLrequests.Asyoucansee,atremendousamountofpowerisavailableintheJSPworld.DevelopersarefreetowriteWebpagesthatlookmostlylikeHTML,exceptwherecalloutstoJavaarerequired.But,atthesametime,theyarefreetodevelopfullyfleshed-outobject-orientedapplicationsusingallthefeaturesthatJavacanbringtobear.Theyalsogetallthebenefitsofservlets,includingsessionpersistence.WhyDoWeNeedDatabases?Well,onereasonissothatLarryEllisonofOraclecanaffordtokeephimselfonProzacwhenhethinksaboutBillGates.Amoreseriousansweristhesamereasonthatdrovemantofirstpressastickagainstapieceofwetmud:becauseit'sgoodtowritethingsdown.Webserversaremarvelouscreatures,butthey'reabitlikeidiotsavants.AskthemtoserveaWebpageorrunapieceofJava,andtheyperformlikeachamp.Butstartaskingthemtorememberwhattheydidfiveminutesago,andtheydevelopamnesiafasterthanacharacterinasoapopera.Thefirstandmostimportantreasonthatyouusedatabasesisthatthere'salotinane-commercetransactionthatyouneedtorememberandtrack:?Auser'sname,address,creditcard,andotherinformationpreviouslyenteredonaregistrationpage?hattheusermighthaveputintoashoppingcartandleftfromaprevioustransaction?Whatitemsareinstock,alongwiththeirprice,description,andsoon?Ordersthatneedtobefulfilled,ordersthathavebeenshipped,anditemsthathavebeenbackordered.Now,youcouldstoreallthisinformationinaflatfileontheserver'sharddisk,butthereareotherimportantpropertiesthatyouwanttohaveforthisdata:?Youwanttobeabletobackoutatransactionifpartofitfails.?YouwanttobeabletolocatethedatasomewheremoresecurethantheWebserver,whichcouldbeinaDMZoroutsidethefirewallaltogether.?Youwanttobeabletoaccessdatasuchasuserdataorproductsquickly,eveniftherearethousandsormillionsofthem.Whenyouaddtheseitemstotheshoppinglist,onlyarelationaldatabasewillreallydothejobeffectively.MySQLManysitesdon'tneedthebattleshipstrength(andpricetag)ofOracle.MySQLisanopen-sourceSQLdatabaseavailableforanyonetouse,withmany(althoughnotall)ofthefeaturesofitsbigbrothers,suchasOracle.MySQLisavailableforjustaboutanycomputerthathasdecentpower—itisfairlylightweightontheprocessorandeasytoinstall(10minutes,asopposedtomultiplehoursforOracle).So,perhapsyouarewondering,what'sthecatch?WhatareyounotgettinginMySQLthatmakespeopleturntoOracle?Well,MySQLisaneatlittlepackage,butitismissingsomethingsthatwouldbenicetohaveinaperfectworld.AmajorfeaturethatMySQLdoesnotofferisdatabaseconsistencychecking.Youcanuseforeignkeytagsinyourschema,butMySQLcheerfullyignoresthem.AlotofDBAsIknowwouldconsiderthisaverybadthing.Aforeignkeyconstraintpreventsyoufromcreatinginconsistentdata.Forexample,let'ssupposethatyouhadaschemethatlookedlikethis:CREATETABLEUSER(USERIDINTEGER,FIRST_NAMEVARCHAR(80),LAST_NAMEVARCHAR(80));CREATETABLEPURCHASE(USERIDFOREIGNKEYUSER(USERID),ITEMINTEGER,QUANTITYINTEGER);InadatabasesuchasOracle's,ifyoucreatedanentryinthePURCHASEtablewithauserIDof3,therewouldhavetoalreadybeauserIDof3intheUSERtableoranerrorwouldoccur.Similarly,youcouldn'tdeleteuser3fromUSERifitwasreferencedinPURCHASE.TheMySQLfolksmakeaprettyimpassionedargumentintheirdocumentationthatdependingonforeignkeysfordataintegrityisabadideaanyway,butconvincingyourDBAofthisphilosophyislikelytodegradeintoareligiousdebate.Inaddition,someotherfeaturesaremissing,suchassubselectsandselectinto.Butprobablytheothermajorpiecethatyouwillmissistherollback/commitfunctionality.MySQLdoesimplementrollbackandcommitforcertaintypesoftables,butnotallofthem.Again,theMySQLfolksoffertheirownspinonwhythisisokay,butbeingabletorollbacktransactionsis(inmyopinion)importantenoughtomakesurethatyouhaveitavailable.Rollbackallowsyoutosetasavepointonthedatabasebeforestartingtodoaseriesoftransactionswithit,andbeabletoeitherrollbacktotheoriginalstateorcommitthechangesattheend.Forexample,whenrecordingapurchase,youneedtorecordadebitagainsttheuser'saccountandenterarecordintotheshippingtablesothatyou'llknowlatertoshiptheitem.Let'ssaythatthesecondpartfails.Youwouldn'twanttochargetheuserbutnotshiptheitem.Thus,you'dwanttorollbacktothestatebeforethetransactionbegan.So,MySQLisn'tafull-blownproductiondatabase—atleast,notyet.It'sstillgoodenoughforprobably90%ofthee-commercesitesintheworld,however.Andversion4.0,whichisinalphaasofthiswriting,addressesanumberoftheseconcerns,includingrow-levellockingandtransactioncontrol.PuttingTomcatandMySQLTogetherCombiningTomcatandMySQLprovidesapowerful,reliable,andfreeplatformthatyoucanusetolearn,develop,anddeployJSPapplications.And,bestofall,thecodethatyoudevelopusingthisplatformwillrunnicelyusingiPlanetandOracleorWebSphereandSQLServer.Asalearningtoolthetwotogetherarealmost"referenceimplementations"oftheirrespectiveprotocols(JSPandSQL).Asaresult,youwon'tpickupanynastyvendor-proprietarybadhabitswhileyou'regettinguptospeed.Inaddition,youcanenjoytheknowledgethatyouaresupportingtheopen-sourcesoftwaremovement.Open-sourcesoftwareiscodethatismadefreelyavailableunderoneofseveralpubliclicenses,frequentlytheGNUGeneralPublicLicense(GPL).Whyisitgoodtosupportthismovement?Therearetwosidestothisanswer:onetechnicalandonepolitical.Technically,it'sagoodthingbecauseopen-sourcesoftwaretendstoencouragethedevelopmentofopenstandardssuchasJSPandJDBC,allowingyoutochooseyourtoolsfromamongalargergroupratherthanbeinglockedintoonevendor'sproprietarysolution.It'sapositivethingpoliticallybecauseitkeepsthelargecompanieshonest.WebLogicandiPlanethavetostaycompetitiveandresponsivebecausetheyknowthatthere'safreesolutionoutthereiftheyaren't.Andwhenyouuseopen-sourcesoftware,youaresendingamessagethatyouroverridingconcernsarefeaturesandreliability,nothavingalargecompanytosueifsomethinggoeswrong.MySQL和JSP的Web應(yīng)用程序JSP開發(fā)人員構(gòu)建Web應(yīng)用程序時遇到需要強(qiáng)大的數(shù)據(jù)庫連接的特殊問題。MySQL和JSP的Web應(yīng)用程序解決了構(gòu)建數(shù)據(jù)驅(qū)動的應(yīng)用程序JavaServer頁面上的發(fā)展模式為基礎(chǔ)的挑戰(zhàn)。MySQL和JSP的Web應(yīng)用程序開始一個對JSP數(shù)據(jù)庫開發(fā)-JavaServer頁面,JDBC和數(shù)據(jù)庫模式所需的核心技術(shù)概述。該書然后概述并提出了互聯(lián)網(wǎng)商業(yè)應(yīng)用演示,如接收和處理用戶輸入,設(shè)計和實施業(yè)務(wù)規(guī)則,并平衡服務(wù)器上的用戶負(fù)載的概念。通過JDBC(Java數(shù)據(jù)庫連接),開發(fā)人員能夠與大多數(shù)商業(yè)數(shù)據(jù)庫如Oracle進(jìn)行溝通。在MySQL和JSP的Web應(yīng)用中心提交了一份關(guān)于開源工具M(jìn)ySQL和Tomcat的解決方案,使讀者一個經(jīng)濟(jì)實惠的方式來測試書中的例子的應(yīng)用程序和試驗。那么JSP是怎么一回事呢?如果您符合上述要求的,你對這個問題的答案應(yīng)該已經(jīng)有一個相當(dāng)不錯的理解。JSP是所有關(guān)于做高度面向?qū)ο蟮木W(wǎng)站,可以利用所有的現(xiàn)代軟件工程最佳實踐。這些做法包括諸如SQL數(shù)據(jù)庫和基于UML設(shè)計的東西。這并不是說JSP是萬能的而且使用它會自動將您的網(wǎng)站上的工程藝術(shù)的典范。這只是盡可能地用其他任何技術(shù)用JSP設(shè)計不良網(wǎng)站。這就是為什么,當(dāng)你詳細(xì)檢查文本的時候,你會看到如何合并最佳方法以及項目得到的壓力時候如何避免方便的陷阱。JSP它本身就是從第一個靜態(tài)Web服務(wù)器開始的一個沿路徑循序漸進(jìn)的步驟,通過CGI移動功能的服務(wù)器,最后腳本功能的服務(wù)器的第一代。JSP是一個比Java引擎能夠熟悉網(wǎng)頁的的少了一個Java組件的Web服務(wù)器。JSP是由Javaservlet發(fā)展演變而來的。servlet允許開發(fā)人員處理傳入使用Java程序能夠訪問的所有正常的信息,一個共同的網(wǎng)關(guān)接口(CGI)程序?qū)eb請求。此外,該servlet可以訪問會話持久對象。這是Java的都與一個特定的用戶會話,可用于存儲請求之間的狀態(tài)對象。Servlet編程是一個允許開發(fā)人員編寫結(jié)構(gòu)良好的模塊化的Web應(yīng)用程序使用面向?qū)ο笳Z言的重要一步。它還解決了狀態(tài)持久性的問題,用戶和應(yīng)用程序執(zhí)行的一個動作或一系列動作期間讓更多的信息駐留在服務(wù)器上而且較少的反復(fù)在用戶和服務(wù)器之間傳遞。Servlet還遭受一大問題。因為他們最終需要輸出HTML中,HTML編碼必須被嵌入在servlet代碼中。導(dǎo)致如下所示的一段代碼片段:Out.println("<HTML>\n<HEAD>\n<TITLE>ThankyouforRegistering</TITLE></HEAD>\n");Out.println("<IMGSRC=\"thanks.jpg\"WIDTH=200HEIGHT=100ALIGN=\"LEFT\”>");當(dāng)你編碼很多網(wǎng)頁時,這種嵌入式是非常古老非??斓?。此外,必須避免所有引號會導(dǎo)致的很多混亂和如果你遺漏了一個反斜杠帶來難以發(fā)現(xiàn)的錯誤。最終,一個較好的方法出現(xiàn)。假設(shè)你能結(jié)合最好的靜態(tài)HTML頁面和servlet的交互能力。其結(jié)果是JavaServer頁面(在微軟方面,結(jié)果是活動服務(wù)器頁面)。JSP是非常復(fù)雜強(qiáng)大的。在接下來的章節(jié)中,你會通過這個細(xì)節(jié)流程,但就目前而言,這里是主要的步驟:1、接到請求時從使用普通的HTTP請求格式的瀏覽器。2、WEB服務(wù)器切換到JSP的請求,JSP著眼于找到合適的JSP文件。3、.jsp文件轉(zhuǎn)換成.Java文件,包含Java代碼,將創(chuàng)建一個類,它的名稱是從.jsp的文件名而得。4、JSP然后用javac編譯.java文件產(chǎn)生一個.class文件。注意如果一個.class文件已經(jīng)存在而且比.jsp文件新則可以跳過先前的兩步。5、一個新創(chuàng)建的類實例被實例化,并發(fā)送_jspService消息。6、新的實例看看是否已經(jīng)有一個被稱為user的stuff.User對象實例在當(dāng)前連接的用戶會話對象的空間存在。如果沒有,一個實例被實例化。7、作為服務(wù)stuff.jsp的一部分,user實例將被GetUserName()方法調(diào)用。8、如果JSP處理需要訪問數(shù)據(jù)庫中的信息,它將使用JDBC來進(jìn)行連接和處理SQL請求。正如你可以看到,巨大的能量是在現(xiàn)有的JSP世界里。開發(fā)者可以自由編寫大多數(shù)看起來像HTML的Web頁面,除非到Java標(biāo)注是要求最喜歡看的HTML。但是,在同一時間,他們可以自由地充分發(fā)展充實面向?qū)ο蟮膽?yīng)用程序使用Java會帶來負(fù)擔(dān)的所有功能。他們也得到servlet的所有優(yōu)點,包括會話持久性。為什么我們需要的數(shù)據(jù)庫?好,一個原因就是為了讓拉里埃里森想到比爾蓋茨的時候,他的Oracle有能力保持自己百憂解。更嚴(yán)重的回答是相同的原因也就是駕駛?cè)讼劝聪箩槍σ粔K濕粘泥:因為把事情記下來是好的。Web服務(wù)器是了不起的創(chuàng)造,但他們是一個有點像白癡專家。請他們?yōu)橐粋€網(wǎng)頁或運行Java的一段,他們表演的像一個冠軍。但開始要求他們記住他們五分鐘前做了什么,和他們顯露的比一個肥皂劇里的人物失憶還快。第一個也是最重要的原因是你使用的數(shù)據(jù)庫是有大量的數(shù)據(jù)在電子商務(wù)交易里,你必須記住并跟蹤:?一個用戶的姓名,地址,信用卡和其他信息以前進(jìn)入了一個注冊頁面?帽子的用戶可能把以前留下交易放進(jìn)購物車?哪些物品有存貨,以及它們的價格,描述等等?訂單需要履行,訂單已發(fā)貨,并已待補(bǔ)物品?,F(xiàn)在,你可以存儲所有這些信息在服務(wù)器上的硬盤平面文件中,但也有你想保存的數(shù)據(jù)的其他重要屬性:?如果交易部分失敗,您希望能夠收回交易。?您希望能夠找到Web服務(wù)器安全的地方定位數(shù)據(jù),這可能是完全在DMZ或外部的防火墻。?您希望能夠如用戶數(shù)據(jù)或產(chǎn)品快速訪問數(shù)據(jù),即使有數(shù)千或上百萬數(shù)據(jù)。當(dāng)你添加這些項目的購物清單,只有一個關(guān)系數(shù)據(jù)庫才會真正的影響工作效率。MySQL許多網(wǎng)站不需要Oracle的歷史優(yōu)勢(和價格標(biāo)簽)。MySQL是一個開源SQL數(shù)據(jù)庫可供任何人使用,擁有許多(盡管不是全部)的先前數(shù)據(jù)庫的功能,如Oracle。MySQL是可用于幾乎所有的電腦上有相當(dāng)好的能力是相當(dāng)輕量級的處理器,安裝方便(10分鐘,而不像Oracle需要多個小時)。所以,也許你想知道,有什么收獲?沒有得到什么,你在MySQL中,使人們把目光轉(zhuǎn)向到O

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論