JDBC数据库连接外文翻译及原文.docx
- 文档编号:7070963
- 上传时间:2023-01-16
- 格式:DOCX
- 页数:10
- 大小:28.10KB
JDBC数据库连接外文翻译及原文.docx
《JDBC数据库连接外文翻译及原文.docx》由会员分享,可在线阅读,更多相关《JDBC数据库连接外文翻译及原文.docx(10页珍藏版)》请在冰豆网上搜索。
JDBC数据库连接外文翻译及原文
JDBC(JavaDataBaseConnectivity)
JDBC(JavaDataBaseConnectivity,)isaSQLstatementfortheimplementationoftheJavaAPI,foravarietyofrelationaldatabasestoprovideaunifiedvisitbyagroup,it’susingJavalanguagepreparationclassesandinterface.JDBCfortools/databasedevelopmentprovidesastandardAPI,whichcanbuildmoresophisticatedtoolsandinterfacestodatabasedevelopers.PureJavaAPIcanbeusedtopreparedatabaseapplications,atthesametime,JDBCisalsoabrandname.WithJDBC,datasenttothevariousrelationshipsSQLstatementisaveryeasymatter.InotherwordswithJDBCAPI,wedonothavetovisitaSybasedatabasetowritespecializedprocedures,visittheOracledatabasespecificallytowriteaprogram,orvisitInformixdatabaseandthepreparationofanotherprocedure,programmersshouldusetheJDBCAPItowriteaprocedureenough,itcanbesenttothecorrespondingSQLdatabasecalls.Meanwhile,theJavalanguageandJDBCtointegratenon-programmersdonothaveto,withaplatformforthepreparationofdifferentapplications,justwriteitagainintheprocesscanberunonanyplatform,whichistheJavalanguage"Writeonce,runeverywhere"advantage.JavadatabaseConnectArchitectureforJavaapplicationofthestandardmethodofconnectingtothedatabase.JDBCisthecaseofJavaprogrammersAPI,andtherealizationofthedatabaseconnectionisthecaseofserviceprovidersinterfacemodel.
AsAPI,JDBCprogramdevelopmentfortheprovisionofstandardinterfaces,anddatabasevendorsandthird-partymiddlewarevendorstoachieveconnectivityanddatabaseprovidesastandardmethod.JDBCusetheexistingSQLstandard-Supportandotherdatabasesandconnectivitystandards,suchasbridgebetweenODBC.JDBCachievealltheseobjectivesandstandardsforasimple,high-performanceandstrictdefinitionofachievingtypeinterface.Javawithasolid,safe,easytouse,easytounderstandandcanbeautomaticallydownloadedfromtheInternetandothercharacteristicsofthepreparationoftheoutstandingdatabaseapplicationlanguage.NeedisaJavaapplicationDatabasewithavarietyofdifferentproceduresforadialoguebetweenthemethods.TheJDBCisthemechanismforsuchpurposes.JavaJDBCexpandedfunctionality.Forexample,withJavaandJDBCAPIAppletcanbeissuedcontainingthepage,andtheappletmayusetheinformationfromremotedatabasesenterprisescanalsouseJDBCtoallstaffthroughtheIntranetwillbeconnectedtooneormoreInternaldatabase(evenifthosestaffcomputersareusedbyWindows,Macintosh,andUNIX,andothervariousoperatingsystems).AsmoreandmoreprogrammersusingJavaProgramminglanguage,Javafromtheconvenientaccesstothedatabaserequirementsareincreasing.MISadministratorslikethecombinationofJavaandJDBC,becauseitmakesiteasytodisseminateinformationandEconomy.Enterprisescancontinuetousetheirinstalleddatabase,andcaneasilyaccessinformation,evenifthisinformationisstoredinthedifferentdatabasemanagementsystems.Thedevelopmentofnewproceduresisaveryshortperiod.AnEquipmentandversioncontrolwillbegreatlysimplified.Programmerscanprepareonlywhatapplicationsorupdatedonlyonce,andthenputitontheserver,andthenonanypersoncangetthelatestversionoftheapplication.Salesforthebusinessinformationservices,JavaandJDBCforexternalcustomerswithbetteraccesstoinformationupdatemethod.
First,theuseofJDBC
Simplyput,JDBCtodothreethings:
establishaconnectionwiththedatabase,sendSQLstatementsandtheresults.Thefollowingcodesarethebasicexamples:
Connectioncon=DriverManager.getConnection("jdbc:
odbc:
wombat,""login"
"Password");
Statementstmt=con.createStatement();
ResultSetrs=stmt.executeQuery("SELECTa,b,cFROMTable1");
While(rs.next()){
Intx=rs.getInt("a");
Strings=rs.getString("b");
Floatf=rs.getFloat("c");}
BasedontheabovecodeJDBCdatabaseaccesstoasummaryoftheclassic,ofcourse,inthispartofthefollow-upsectionwewilldoadetailedanalysis.
Second,JDBCAPI
JDBCisa"low-level"interface,thatis,itcallsfordirectSQLcommands.Inthisrespectitfunctionsverygood,andotherthantheeasy-to-usedatabaseconnectivityAPI,butitalsohasbeendesignedasabasisinterface,itcanbeestablishedontheHighinterfaceandtools.Highinterfaceis"user-friendly"interface,whichusesamorecomprehensibleandmoreconvenientAPI.ThisAPIisconvertedinthebehind-the-scenessuchasJDBCsuchalow-levelinterface.Intherelationaldatabase"object/relationship"mapping,eachrowinthetablecorrespondingtothecategoryofanexample,thevalueofeachcolumntheexamplesshouldbeanattribute.Therefore,programmerscandirectlyoperateontheJavaobjects;SQLfordataaccesscallwillbe"undertheguiseof"automaticallygenerated.Theycanalsobemorecomplexmapping,forexample,anumberofrowsinthetableintegratedintoaJavaclass.WiththeinterestofthepeopleofJDBCthegrowing,andmoreandmoredevelopershavebeenusingJDBC-basedtoolsSothatthepreparationprocessmoreeasily.Programmershasbeentryingtomakeinthepreparationofend-userdatabaseaccesshasbecomemoresimpleapplications.Forexample,applicationscanprovideachoiceofAccordingtothemandateofthemenu.Taskwaschosen,theapplicationwillbegiventipsandblankselectedforthetaskofcompletingtheimplementationofthenecessaryinformation.ApplicationproceduresfortheimportationoftherequiredinformationwillautomaticallycallforSQLOrder.Insuchaprocesswiththeassistance,eveniftheydonotunderstandthefundamentalSQLsyntax,butalsocanperformdatabasetasks.
Third,JDBCandODBCcomparedwithotherAPI
Currently,Microsoft'sODBCAPIisthemostwidelyusedforthevisitoftherelationaldatabaseprogramminginterface.Itcanconnectalmostallplatformsalmostalldatabases.ForWhatJavadoesnotuseODBC?
Theanswertothisquestionis:
JavacanuseODBC,butpreferablywiththehelpoftheJDBCtoJDBC-ODBCBridgeintheformofuseofthispoint,welatersay.Theproblemnowhasbecome:
"WhydoweneedJDBC?
"Theanswerisclear:
ODBCnotsuitablefordirectuseinJava,becauseitusesClanguageinterface.TransferredfromJavaCcodeinthelocalsecurity,achievedsolidandproceduralaspectsoftheautomatictransplantationhasmanyshortcomings.FromODBCCAPIJavaAPItotheliteraltranslationisnotadvisable.Forexample,Javadoesnotguide,andithasODBCindicatorsusedverywidely(includingveryerror-proneGuidelines"void*").YoucanimagineJDBCwillbeconvertedintotheobject-orientedinterfacetotheODBC,andtheobject-orientedinterfacetomakeiteasierforJavaprogrammerstoreceive.ODBCisdifficulttolearn.Itsimpleandadvancedfeaturesofthemix,andeventhesimplequery,theoptionsareextremelycomplex.Onthecontrary,JDBCtoguaranteesimplefunctionofsimplicity,Atthesametime,ifnecessary,toallowtheuseofadvancedfeatures.Theopeningof"pureJava"mechanismneedssuchasJDBCJavaAPI.IfyouuseODBC,itisnecessarytomanuallywillbeODBCdrivermanagementanddriverinstallationineachclientmachines.IfcompletelywritteninJavaJDBCDriverinalltheJDBCcodeontheJavaplatform(fromthecomputernetworktothemainframe)canbeAutomaticinstallation,andguaranteethesafetyoftransplantation.
Inshort,JDBCAPIforSQLabstractandbasicconceptsofJavaisanaturalinterface.ItisbuiltonODBCratherthanstartingfromscratch.Therefore,programmerswillbefamiliarwithODBCJDBCfoundveryeasytouse.ODBCJDBCretainsthebasicdesignfeatures;Infact,thetwointerfacesarebasedontheX/OpenSQLCLI(call-levelinterface).Amongthemthelargestdistrict,anotheris:
JavaJDBCtostyleandbasedonthemeritsandoptimization,moreeasytouse.
Atpresent,MicrosofthasintroducedanewadditiontoODBCAPI:
RDO,ADOandOLEDB.ThesedesigninmanywaysandJDBCisthesame,thatis,theyaretheobject-orientedBasedonthedatabaseinterfaceandcanbeachievedonODBCinthecategory.Buttheinterface,wedidnotseeanyspecialfeaturesthatmaketheirchoiceweneedtoturntoalternativeODBC,especiallyintheODBCFloodingHasbeenestablishedprocedureforbettermarketconditions.TheyalsoisthelargestintheODBCaddadecorationonly.
Forth,JDBContheB/SandC/Smodesupport
JDBCAPIsupportsboththetwo-tiermodelofdatabaseaccess(C/S),buthasalsosupportedthethree-tiermodel(B/S).Inthetwo-tiermodel,Javaappletorapplicationwillbedirectlyintothedatabasetodialogue.ThiswillrequireaJDBCdrivertovisitwiththespecificdatabasemanagementsystemstocommunicate.UsersofSQLstatementssenttothedatabase,anditsresultswillbereturnedtouser.Databasecanbelocatedonanothercomputer,usersconnectedtotheabovenetwork.Thisiscalledclient/serverconfiguration,user'scomputerfortheclient,providingdatabasecomputingMachinesforservers.Intranetnetworkcanbe(itcanbelinkedtocompanystaff),itcanalsobeaninternet.
Inthethree-tiermodel,theorderwasfirstsenttothe"middlelayer",andthenbytheSQLstatementitsenttothedatabase.DatabaseonSQLstatementprocessedandtheresultssentbacktothemiddleLayer,themiddlelayerthentheresultsreturnedtousers.MISmanagershavediscoveredthethree-tiermodelisveryattractive,becausethemiddlelayercanbeusedtocontrolaccesstocompanydataandcanbeusedforthenewertypes.InAnotheradvantageofinter-layer,theusercanusetheeasy-to-usehigh-levelAPI,andthemiddlelayerwillbeconverted
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- JDBC 数据库连接 外文 翻译 原文