Executing Java programs from PL/SQL
Similar to C programs, Oracle can communicate with Java classes as external procedures, too. Unlike C external programs, the Java classes and Java source files are stored as schema objects in the database. But the caveat here is that the Java classes must be operational in the logical side and not on the user interface. It implies that the Java programs which offer generic utility or data processing operations are the best candidates to be loaded into Oracle.
Invoking Java code from PL/SQL not only reduces the network overhead from the client but it also helps in the distribution of logic across the layers and reduces code redundancy. Under this section, we will discuss how to load a Java class into the database and access it through the call specification.
Unlike C external procedures, calling Java program from PL/SQL is convenient. There is no dependency on the shared library, too. But yes, there is something known as Libunit which is like the Java shared...