Using DBMS_JAVA
The Oracle built-in package DBMS_JAVA gives you access to and the ability to modify various characteristics of the Java Virtual Machine in the database.
The DBMS_JAVA package contains a large number of programs, many of which are intended for Oracle internal use only. Nevertheless, we can take advantage of a number of very useful programs; most can also be called within SQL statements. Table 27-4 summarizes some of the DBMS_JAVA programs. As noted earlier in the chapter, DBMS_JAVA also offers programs to manage security and permissions.
Table 27-4. Common DBMS_JAVA programs
Program | Description |
|---|---|
LONGNAME function | Obtains the full (long) Java name for a given Oracle short name |
GET_COMPILER_OPTION function | Looks up an option in the Java options table |
SET_COMPILER_OPTION procedure | Sets a value in the Java options table and creates the table, if one does not exist |
RESET_COMPILER_OPTION procedure | Resets a compiler option in the Java options table |
SET_OUTPUT procedure | Redirects Java output to the DBMS_OUTPUT text buffer |
EXPORT_SOURCE procedure | Exports a Java source schema object into an Oracle LOB |
EXPORT_RESOURCE procedure | Exports a Java resource schema object into an Oracle LOB |
EXPORT_CLASS procedure | Exports a Java class schema object into an Oracle LOB |
These programs are explored in more detail in the following sections.
LONGNAME: Converting Java Long Names
Java class names can easily exceed the maximum SQL identifier length of 30 characters. In such cases, Oracle creates a unique “short name” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access