We saw with JTSVersion.getJTSVersion
and getJVMProperty
how easy it is to write a new PL/SQL function that executes a Java method within the JVM. These Java classes and methods are called
Java Stored Procedures. As we have seen, creating an interface between PL/SQL and Java is easy. But it is important to note that:
Java Stored Procedures are by default executed with invokers rights
PL/SQL procedures are by default executed with definer's rights
When writing functions using Java classes and methods, one must comply with the following rules:
No constructor method is needed
Variables and methods must be declared
[b]static[/b]
Use the default database connection (no user ID/password required: uses session connection)
Declare output variables as arrays [where output is not singular]
Console output from
System.out.println
statements will be written to trace files in the OracleUDUMP
destination directory [get friendly with your DBA!]