Using loadjava

The loadjava utility is an operating system command-line utility that uploads Java files into the database. The first time you run loadjava in a schema, it creates a number of elements for its own use:

CREATE$JAVA$LOB$TABLE

A table created in each schema, containing Java code elements. Each new class you load using loadjava will generate one row in this table.

JAVA$CLASS$MD5$TABLE

A hash table , also referred to as the digest table, used to track the loading of Java elements into a given schema.

LOADLOBS

A package that is installed in each schema, used to load Java code elements as large objects (LOBs) into the database.

Using LOADLOBS, loadjava moves Java files into a BLOB column in the database table CREATE$JAVA$LOB$TABLE. It also checks the JAVA$CLASS$MD5$TABLE.MD5 hash value to see if the loaded classes have been loaded previously and whether they have been changed (thereby minimizing the need to reload).[45]

This is done to avoid unnecessary invalidation of dependent classes. It then calls the new DDL command CREATE JAVA to load the Java classes from the BLOB column of CREATE$JAVA$LOB$TABLE into the RDBMS as schema objects. This loading occurs only if:

  • The class is being loaded for the first time

  • The class has been changed

  • The -force option is supplied

Figure 22-3 illustrates the loading of Java objects into the Oracle database.

Loading Java elements into Oracle

Figure 22-3. Loading Java elements ...

Get Oracle PL/SQL Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.