订单管理系统中英文对照外文翻译文献_第1页
订单管理系统中英文对照外文翻译文献_第2页
订单管理系统中英文对照外文翻译文献_第3页
订单管理系统中英文对照外文翻译文献_第4页
订单管理系统中英文对照外文翻译文献_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

中英文对照外文翻译(文档含英文原文和中文翻译)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应用程序JSP开发人员构建Web应用程序时遇到需要强大的数据库连接的特殊问题。MySQL和JSP的Web应用程序解决了构建数据驱动的应用程序JavaServer页面上的发展模式为基础的挑战。MySQL和JSP的Web应用程序开始一个对JSP数据库开发-JavaServer页面,JDBC和数据库模式所需的核心技术概述。该书然后概述并提出了互联网商业应用演示,如接收和处理用户输入,设计和实施业务规则,并平衡服务器上的用户负载的概念。通过JDBC(Java数据库连接),开发人员能够与大多数商业数据库如Oracle进行沟通。在MySQL和JSP的Web应用中心提交了一份关于开源工具MySQL和Tomcat的解决方案,使读者一个经济实惠的方式来测试书中的例子的应用程序和试验。那么JSP是怎么一回事呢?如果您符合上述要求的,你对这个问题的答案应该已经有一个相当不错的理解。JSP是所有关于做高度面向对象的网站,可以利用所有的现代软件工程最佳实践。这些做法包括诸如SQL数据库和基于UML设计的东西。这并不是说JSP是万能的而且使用它会自动将您的网站上的工程艺术的典范。这只是尽可能地用其他任何技术用JSP设计不良网站。这就是为什么,当你详细检查文本的时候,你会看到如何合并最佳方法以及项目得到的压力时候如何避免方便的陷阱。JSP它本身就是从第一个静态Web服务器开始的一个沿路径循序渐进的步骤,通过CGI移动功能的服务器,最后脚本功能的服务器的第一代。JSP是一个比Java引擎能够熟悉网页的的少了一个Java组件的Web服务器。JSP是由Javaservlet发展演变而来的。servlet允许开发人员处理传入使用Java程序能够访问的所有正常的信息,一个共同的网关接口(CGI)程序将Web请求。此外,该servlet可以访问会话持久对象。这是Java的都与一个特定的用户会话,可用于存储请求之间的状态对象。Servlet编程是一个允许开发人员编写结构良好的模块化的Web应用程序使用面向对象语言的重要一步。它还解决了状态持久性的问题,用户和应用程序执行的一个动作或一系列动作期间让更多的信息驻留在服务器上而且较少的反复在用户和服务器之间传递。Servlet还遭受一大问题。因为他们最终需要输出HTML中,HTML编码必须被嵌入在servlet代码中。导致如下所示的一段代码片段:Out.println("<HTML>\n<HEAD>\n<TITLE>ThankyouforRegistering</TITLE></HEAD>\n");Out.println("<IMGSRC=\"thanks.jpg\"WIDTH=200HEIGHT=100ALIGN=\"LEFT\”>");当你编码很多网页时,这种嵌入式是非常古老非常快的。此外,必须避免所有引号会导致的很多混乱和如果你遗漏了一个反斜杠带来难以发现的错误。最终,一个较好的方法出现。假设你能结合最好的静态HTML页面和servlet的交互能力。其结果是JavaServer页面(在微软方面,结果是活动服务器页面)。JSP是非常复杂强大的。在接下来的章节中,你会通过这个细节流程,但就目前而言,这里是主要的步骤:1、接到请求时从使用普通的HTTP请求格式的浏览器。2、WEB服务器切换到JSP的请求,JSP着眼于找到合适的JSP文件。3、.jsp文件转换成.Java文件,包含Java代码,将创建一个类,它的名称是从.jsp的文件名而得。4、JSP然后用javac编译.java文件产生一个.class文件。注意如果一个.class文件已经存在而且比.jsp文件新则可以跳过先前的两步。5、一个新创建的类实例被实例化,并发送_jspService消息。6、新的实例看看是否已经有一个被称为user的stuff.User对象实例在当前连接的用户会话对象的空间存在。如果没有,一个实例被实例化。7、作为服务stuff.jsp的一部分,user实例将被GetUserName()方法调用。8、如果JSP处理需要访问数据库中的信息,它将使用JDBC来进行连接和处理SQL请求。正如你可以看到,巨大的能量是在现有的JSP世界里。开发者可以自由编写大多数看起来像HTML的Web页面,除非到Java标注是要求最喜欢看的HTML。但是,在同一时间,他们可以自由地充分发展充实面向对象的应用程序使用Java会带来负担的所有功能。他们也得到servlet的所有优点,包括会话持久性。为什么我们需要的数据库?好,一个原因就是为了让拉里埃里森想到比尔盖茨的时候,他的Oracle有能力保持自己百忧解。更严重的回答是相同的原因也就是驾驶人先按下针对一块湿粘泥:因为把事情记下来是好的。Web服务器是了不起的创造,但他们是一个有点像白痴专家。请他们为一个网页或运行Java的一段,他们表演的像一个冠军。但开始要求他们记住他们五分钟前做了什么,和他们显露的比一个肥皂剧里的人物失忆还快。第一个也是最重要的原因是你使用的数据库是有大量的数据在电子商务交易里,你必须记住并跟踪:•一个用户的姓名,地址,信用卡和其他信息以前进入了一个注册页面•帽子的用户可能把以前留下交易放进购物车•哪些物品有存货,以及它们的价格,描述等等•订单需要履行,订单已发货,并已待补物品。现在,你可以存储所有这些信息在服务器上的硬盘平面文件中,但也有你想保存的数据的其他重要属性:•如果交易部分失败,您希望能够收回交易。•您希望能够找到Web服务器安全的地方定位数据,这可能是完全在DMZ或外部的防火墙。•您希望能够如用户数据或产品快速访问数据,即使有数千或上百万数据。当你添加这些项目的购物清单,只有一个关系数据库才会真正的影响工作效率。MySQL许多网站不需要Oracle的历史优势(和价格标签)。MySQL是一个开源SQL数据库可供任何人使用,拥有许多(尽管不是全部)的先前数据库的功能,如Oracle。MySQL是可用于几乎所有的电脑上有相当好的能力是相当轻量级的处理器,安装方便(10分钟,而不像Oracle需要多个小时)。所以,也许你想知道,有什么收获?没有得到什么,你在MySQL中,使人们把目光转向到O

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论