Dropping Java from database using the original .jar file

To load java classes into the database from a Java Archive (.jar), place the jarfile in a directory that can be reached from within the database (i.e. an Oracle directory has to be present that points to the physical directory).

Then issue the following command:

exec dbms_java.loadjava( ' -verbose -resolve -force -genmissing <physical directory>/myjarfile.jar);

Querying all existent database objects created from this jarfile shows a list of classes. Now, to drop the classes created by the loadjava-call one can issue:

exec dbms_java.dropjava('-verbose <physical directory>/myjarfile.jar')

The catch here is dat the jarfile has to be present in the directory. So even if you have it loaded in the database, keep it somewhere safe…


Get every new post delivered to your Inbox.