订单管理系统中英文对照外文翻译文献.docx

上传人:b****1 文档编号:3087628 上传时间:2023-05-05 格式:DOCX 页数:12 大小:25.07KB
下载 相关 举报
订单管理系统中英文对照外文翻译文献.docx_第1页
第1页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第2页
第2页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第3页
第3页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第4页
第4页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第5页
第5页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第6页
第6页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第7页
第7页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第8页
第8页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第9页
第9页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第10页
第10页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第11页
第11页 / 共12页
订单管理系统中英文对照外文翻译文献.docx_第12页
第12页 / 共12页
亲,该文档总共12页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

订单管理系统中英文对照外文翻译文献.docx

《订单管理系统中英文对照外文翻译文献.docx》由会员分享,可在线阅读,更多相关《订单管理系统中英文对照外文翻译文献.docx(12页珍藏版)》请在冰点文库上搜索。

订单管理系统中英文对照外文翻译文献.docx

订单管理系统中英文对照外文翻译文献

中英文对照外文翻译

(文档含英文原文和中文翻译)

MySQLandJSPWebapplications

JSPdevelopersencounteruniqueproblemswhenbuildingwebapplicationsthatrequireintensedatabaseconnectivity.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("\n\nThankyoufor</p><p>Registering\n");

Out.println("");

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.

MySQL

Manysitesdon'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,including

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2