Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Oracle PL/SQL Language Pocket Reference- P3: This pocket guide features quick-reference information to help you use Oracle's PL/SQL language. It includes coverage of PL/SQL features in the newest version of Oracle, Oracle8i. It is a companion to Steven Feuerstein and Bill Pribyl's bestselling Oracle PL/SQL Programming. Updated for Oracle8, that large volume (nearly 1,000 pages) fills a huge gap in the Oracle market, providing developers with a single, comprehensive guide to building applications with PL/SQL and building them the right way. . | routines can now call the JSP as if it were another PL SQL module. 1.19.1 Example Let s write a simple Hello World JSP that will accept an argument package oreilly.plsquick.demos public class Hello public static String sayIt String toWhom return Hello toWhom Saved in a file called Hello.java we can load the source code directly into Oracle. Doing so will automatically compile the code. A simple form of the loadjava command loadjava -user scott tiger -oci8 oreilly plsquick demos Hello.java The Hello.java file follows the Java file placement convention for packages and so exists in a subdirectory named oreilly plsquick demos. Now we can fire up our favorite SQL interpreter connect as SCOTT TIGER and create the call spec for the Hello.sayIt method CREATE FUNCTION hello_there to_whom IN VARCHAR2 RETURN VARCHAR2 AS LANGUAGE JAVA NAME oreilly.plsquick.demos.Hello.sayIt java.lang.String return java.lang.String Now we can call our function very easily BEGIN DBMS_OUTPUT.PUT_LINE hello_there world END And we get Hello world Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. as the expected output. 1.19.2 Publishing Java to PL SQL To write a call spec use the AS LANGUAGE JAVA clause in a CREATE statement. The syntax for this clause is IS AS LANGUAGE JAVA NAME method_fullname type_fullname . return type_fullname method_fullname is the package-qualified name of the Java class and method. It is case-sensitive and uses dots to separate parts of the package full name. typefullname is the package-qualified name of the Java datatype. Notice that a simple string not an SQL name follows the NAME keyword. Type mapping follows most JDBC rules regarding the legal mapping of SQL types to Java types. Oracle extensions exist for Oracle-specific datatypes. Most datatype mappings are relatively straightforward but passing Oracle8 objects of a user-defined type is harder than one would think. Oracle provides a JPublisher tool that generates the Java required to .