欢迎来到天天文库
浏览记录
ID:36201703
大小:127.00 KB
页数:35页
时间:2019-05-07
《java 与 pl_sql集成( 35 )》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、HowcanweintegratePL/SQLandJavatodevelopapplications?PresentedbyYun-HsiangWuIS8900AdvancedSQLwithOracleDecember18,2002IntroductionWhydoprogrammersusestoredprocedures?Storedproceduresareabletoprocessasetofoperationsinacallandtheyhavebetterperformanceofdata-i
2、ntensiveoperations.StartingwithOracle8i,Oraclesupportstwostoredprocedures,PL/SQLstoredproceduresandJavastoredproceduresPL/SQLStoredproceduresBeforeOracle8i,PL/SQListheonlylanguagethatcanbeusedinthedatabase.PL/SQListheprocedurallanguageextensiontoSQLanditen
3、capsulatesSQLstatementsinprocedurallogicandexecutealldatabaseobjecttypes.JavaStoredproceduresStartingwithOracle8i,OraclesupportsJavainthedatabase.JavastoredproceduresalsocanencapsulateSQLstatementsthatrunwithinthedatabaseviaprocedurallogicanditcanavoidover
4、headofnetworks.TerminologyofPL/SQLvs.JavaTerminologyofPL/SQLvs.JavaTerminologyofPL/SQLvs.JavaTerminologyofPL/SQLvs.JavaHowtodevelopJavaStoredproceduresStep1:TocreateanewJavaclassorreuseanexistingonethatmeetyourneed.OracleprovidesJDeveloperandsupportsmanyot
5、herJavaIDEssuchasSymantec'sVisualCafé,andBorland'sJbuilder.HowtodevelopJavaStoredproceduresStep2:ToloadJavaprogramintodatabasetobestoredasJavaschemeobjects.TheprogramcanloadJavainoneofthefollowingforms:Javasourcefilesandcompiledinthedatabase.compiledoutsid
6、ethedatabaseandbeloadedas.classor.jarfilesloadedasJavaresourcefilesHowtodevelopJavaStoredproceduresTwomethodtoloadJava:UsingCreateJavastatementstoloadJavasource,binaries,orresourcefilesintothedatabasefromabinaryfileontheoperatingsystemlevelorfromaLOBcolumn
7、inthedatabase.UsingloadjavautilitytoloadJavaprogramsintothedatabase.HowtodevelopJavaStoredproceduresStep3:PublishtheJavacodes.ThreeissuesshouldbeaddressedbeforepublishingJavaclasses(OracleTechnicalWhitePaper,1999):MappingSQLtypestoJavatypes.MappingSQLparam
8、etermodestoJavaparametermodes.PrivilegesunderwhichtheJavaprogramswillexecute.HowtodevelopJavaStoredproceduresOncefinishedaddressingthesethreeissues,theprogrammerscanwritecallspecificationstocontrolthemappingf
此文档下载收益归作者所有