Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Programming PL SQL.doc
Скачиваний:
3
Добавлен:
01.07.2025
Размер:
5.06 Mб
Скачать

22.5 Using dropjava

The dropjava utility reverses the action of loadjava. It converts filenames into the names of schema objects, drops the schema objects, and finally deletes their digest table rows. Dropping a class invalidates classes that depend on it directly or indirectly. Dropping a source also drops classes derived from it.

Here is the syntax:

dropjava {-user | -u} username/password[@database]

[-option_name [-option_name] ...] filename [filename] ...

where option_name can be one or more of many options, some of which are listed below:

{ {oci8 | o}

| {schema | s} schema_name

| {thin | t}

| {verbose | v}

| {help}

| {encoding}

| {synonym}}

On the command line, you can enter the names of Java source, class, and resource files, SQLJ input files, and uncompressed .jar files and .zip archives, in any order.

Table 22-3 summarizes the common dropjava command-line options.

Table 22-3. Common dropjava options

Option

Description

-oci8

Directs dropjava to communicate with the database using the OCI JDBC driver. This option (the default) and -thin are mutually exclusive.

-schema

Drops Java schema objects from the specified schema. If this option is not specified, then the logon schema is used.

You must have the DROP ANY PROCEDURE privilege to drop objects from another user's schema.

-thin

Directs dropjava to communicate with the database using the thin JDBC driver. This option and -oci8 (the default) are mutually exclusive.

-verbose

Enables the verbose mode, in which progress messages are displayed.

22.6 Managing Java in the Database

This section explores in more detail issues related to the way Java elements are stored in the database and how you can manage those elements.

22.6.1 The Java Namespace in Oracle

Oracle stores each Java class in the database as a schema object. The name of that object is derived from (but is not the same as) the fully qualified name of the class; this name includes the names of any containing packages. The full name of the class OracleSimpleChecker, for example, is as follows:

oracle.sqlj.checker.OracleSimpleChecker

In the database, however, the full name of the Java schema object would be:

oracle/sqlj/checker/OracleSimpleChecker

In other words, once stored in the Oracle RDBMS, slashes replace dots.

An object name in Oracle, whether the name of a database table or a Java class, cannot be longer than 30 characters. Java does not have this restriction; you can have much longer names. Oracle will allow you to load a Java class into Oracle with a name of up to 4000 characters. If the Java element name has more than 30 characters, Oracle will automatically generate a valid alias (less than 31 characters) for that element.

But don't worry! You never have to reference that alias. You can instead continue to use the real name for your Java element in your code. Oracle will map that long name automatically to its alias (the schema name) when necessary.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]