To create the directory object, you must grant user scott the CREATE
ANY DIRECTORY privilege, then execute the CREATE DIRECTORY statement,
as follows:
CONNECT System/Manager
GRANT CREATE ANY DIRECTORY TO Scott IDENTIFIED BY Tiger;
CONNECT Scott/Tiger
CREATE DIRECTORY Bfile_dir AS '/home/java/bin';
Now, you are ready to create the class libunit, as follows:
CREATE JAVA CLASS USING BFILE (Bfile_dir, 'Agent.class');
The name of the libunit is derived from the name of the class.
Alternatively, you can use the command-line utility LoadJava. This
uploads Java binaries and resources into a system-generated database
table, then uses the CREATE JAVA statement to load the Java files into
RDBMS libunits. You can upload Java files from file systems, Java
IDEs, intranets, or the Internet.
To use loadJava, there is a metalink article on it. Note:114009.1
Allan W. Tham