Adding the Java engine to Oracle databases is one of the most exciting features of Oracle8i. Therefore:
1) load the Java class and source code into the database;
2) Call Java code in PL/SQL;
3) Call PL/SQL code in Java;
11.1 Oracle Java
1. jserver:
It consists of the following four parts:
1) Java Virtual Machine (JVM)
2) JDBC support
3) sqlj running support
4) sqlj Converter
The JVM name of Oracle is Aurora. by browsing the newly created Oracle8i Database, you can see
Aurora $ orb $ unauthenticated user, used to connect to orb.
All Java components run in the same memory space as PL/SQL, which makes it closely integrated with databases.
Oracle's jserver is completely written in C language and compatible with Sun's Java 1.1.6 compatibility package. At the same time,
Since jserver runs within the scope of the database server, Oracle does not support the GUI library, any attempt to use the GUI on the server
Will generate exceptions.
2. structure:
Advanced PL/SQL programming
49th pages: 49 pages
3. configure system environment variables:
1) in the system environment variable classpath under WINNT, add the translator.zip file in the installation directory of the Oracle data library
To environment variables. For example:
D:/oracle817/sqlj/lib/translator.zip
4. Load the Java class:
Loadjava {-user |-u} username/password [@ database]
[-Option [-option...] filename [filename...];
Parameter description:
1) {-user |-u} username/password [@ database] specifies the database user name and password. Java will be
Load to this user.
2) [-Option [-option...] options include:
① {Andresove | A} is usually not used to edit the source file and parse it when loading each class.
② Debug generates debugging information.
③ {Definer | D} specifies the permission of the user who uses the definition to execute this class; otherwise, the user's execution permission is used.
④ {Encodeing | e} specifies a standard JDK decoding mode, which must match the decoding mode used in the file
Configuration. The default value is Latin1.
⑤ {Force | f} forcibly loads the Java class, even if it was previously loaded.
⑥ {GRANT | G} {usename | rolename} [{usename | rolename}...] will execute the permission of the mounted class
Grant to the listed users and roles.
7. {help | h} generates brief screen help to explain all these options.
Remark {oci8 | O} indicates that loadjava uses the JDBC Driver Based on the Oracle call interface (OCI) when communicating with Oracle.
(Corresponding to the thin driver ).
⑨ Oracleresolver first searches for object references in user mode, and then considers public objects.
Parser {resolve | r} resolves all external references for the loaded class. Otherwise, it will not be parsed until it is run.
(11). {resolve | r} allows you to specify the scope of your parser and control how to parse references of other objects.
(12). {schema | S} loads the object to the specified mode. By default, objects are loaded to the user's own mode.
(13). {synonym | S} creates a synonym for the mounted class. You must have this permission.
Grant create any synonym to Scott;
(14). {thin | t} indicates that javaload uses a thin JDBC driver to connect to the database.
(15). {verbose | V} enables loadjava to display progress information when loading files.
3) filename:
It can be the following extension names: Java class files (. Class ),
Java source files (. Java) and SQL files (. SQL ).
Note: you can load multiple files at the same time.
5. Delete the loaded Java class:
Dropjava {-user |-u} username/password [@ database]
[-Option [-option...] filename [filename...];
Parameter description:
1) {-user |-u} username/password [@ database] specifies the database user name and password. Java will be
Delete from this user.
2) [-Option [-option...] options include:
① {Help | h} generates a brief screen help to explain all these options.
② {Oci8 | O} indicates that loadjava uses the JDBC Driver Based on the Oracle call interface (OCI) when communicating with Oracle.
(Corresponding to the thin driver ).
Advanced PL/SQL programming
50th pages 50 pages
③ {Schema | S} loads the object to the specified mode. By default, objects are loaded to the user's own mode.
④ {Thin | t} indicates that javaload uses a thin JDBC driver to connect to the database.
⑤ {Verbose | V} enables loadjava to display progress information when loading files.
3) filename:
It can be the following extension names: Java class files (. Class ),
Java source files (. Java) and SQL files (. SQL ).
Note: You can delete multiple files at the same time, but the original location of the files remains unchanged. Only files are deleted from the database.
11.2 load, apply, and delete Java
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.