Monday, November 17, 2025

UTILIZE CUSTOM JAVA CLASSES IN OIC INTEGRATIONS (WITHOUT OCI FUNCTIONS)

 

At times we get presented with technical requirements in OIC integration that will require the use of custom developed Java classes (maybe from legacy systems, third party collaborators, cryptography needs, etc.). As easy and straight-forward the requirement sounds, its implementation may not be so, most of the times. The usually suggested way is to compile the Java classes in OCI and create functions. However, what if I tell you that there is another easier way to achieve the requirement?

There is and it assumes that there is an Oracle database in picture (preferably an ATP).

  • 1.     Enable Java in your Oracle database, after which, you may have to bounce the database once.
  • 2.     Import your Java classes using the CREATE JAVA statement. More details on this statement can be known here. Please note that if a class references another class objects, then the class being referenced has to be imported first before proceeding to import the other.
  • 3.     Once you have imported and successfully compiled the necessary Java classes, you will have to wrap the Java classes using PLSQL functions. Please take note that when you create wrappers, you will have to mention the formal data type of its arguments – like java.lang.String for a string type.
  • 4.     Utilize these wrappers by creating another wrapper procedure/function – but this time, using the PLSQL datatypes. These procedures and functions can be invoked from OIC integrations, indirectly utilizing the custom Java classes.

Voila!