The requirement is to call java methods from plsql and I am able to achieve it through loadjava command. The steps which I am following is :
Step 1: Create the Java Class/jar file and place it on unix box
Step 2: Load the Java Class/jar into the Database and i can see a new object in ALL_OBJCETS table with object type as JAVA CLASS
Step 3: Publish the Function: Creating the function/proc using java static method
Step 4: Execute the Function/proc.
And it's working fine for me but the challenge I am facing here when the java classs is defined in java package. for example: the class file is:
==========================
package emrsn.com;
public class DBTEST {
public static String callMe(String input){
return input;
}
}
========================
Now when I am uploading the above java code (class file) in database I can see the object name is "emrsn\com\DBTEST", instead of "DBTEST" in ALL_OBJECTS table and the status is INVALID. I am not able to even recompile the class file in database (using ALTER JAVA CLASS obj_name RESOLVE), when the object name is like emrsn\DBTEST.
Please let em know if there is any other specific way to refer this type of java class file in database , when it is packaged in Java. Can you please let me know how do I use these JAVA class objects (when it is emrsn/com/DBTEST) while creating function or while recompiling this object. As mentioned earlier, I can't recompile them to see the exact error.
ALTER JAVA CLASS com/emrsn/DBTEST RESOLVE
Getting below error
Error report:
SQL Error: ORA-00922: missing or invalid option
00922. 00000 - "missing or invalid option"
*Cause:
And if I am using ALTER JAVA CLASS DBTEST RESOLVE, it's saying object not found. Let me know how I can refer these objects.