Load Java source code in oracle database
CREATE OR REPLACE AND RESOLVE JAVA SOURCE
Compile java code in oracle database
Call java in oracle apps database procedure
writing java code in oracle database
create java code in oracle database
Below is a sample java class that we will compile and call from database function
Step 1: Compile the below java class code in oracle database. Please note that java should be already installed and configured on server else it will throw “ORA-29538: Java not installed” error.
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED APPS.TEST_JAVA_PKG AS public class TestMsgClass { public static String getMessage(String pStr) throws Exception { String sl = ""; try { sl = "This message string is coming from java getMessage method. Input string provided was:" + pStr + ""; } catch (Exception e) { sl = e.getMessage(); } return sl; } }
Step 2: Compile the below code in oracle database. This function calls the java class that we compiled in step 1.
CREATE OR REPLACE FUNCTION xxtest_msg (p_str VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'TestMsgClass.getMessage(java.lang.String) return java.lang.String' ;
Step 3: Run the below anonymous block to call the function which calls java class.
It should return a message as seen in screenshot below.
SET SERVEROUTPUT ON; DECLARE msg VARCHAR2 (2000); BEGIN msg := xxtest_msg ('AbCd'); DBMS_OUTPUT.put_line ('msg:' || msg); END;Related posts:
- Register a test concurrent program from backend in Oracle EBS
- Supervisor Hierarchy and Approval Limits in Oracle EBS R12
- Query to find vacation rules in Oracle R12
- View java class source in oracle database
- Load Java source code in oracle database
- Query to find all APIs of Oracle Apps modules
- OAF customizations queries
- Oracle apps list of concurrent programs in a Request Set
- Query to get Organization Hierarchy in Oracle apps
- Oracle apps query to find incompatible programs blocking a concurrent request
- Form function attached to which responsibility and user
- Query to find the responsibility attached to user in oracle apps
- How to enable debug log in Oracle apps EBS
- Query to find and remove Oracle database locks
- How to add AME role and responsibility to user
- Oracle form attached to which responsibility
- SQL query to get MIME type for file extension
- Query to get concurrent program and executable details
- Query to get responsibility level profile option values
- Query to validate migration of XML/BI Publisher Template and Data Definition
- Query to get details of XML/BI Publisher Template and Data Definition
- Query to get Site level and Organization level Profile Option Value
- PL-SQL code to reset application user password
- PL-SQL code to write a file
- PL-SQL code to read a file
- Query to find second and third highest value
- PL-SQL Procedure to send email with attachment
- PL-SQL to delete Concurrent Program and Executable
- Query to get the details of the lock in the database
- PL-SQL code to delete XML/BI Publisher template and Data Definition
- Query to find Table size
- Query to find Form Personalization
- Query to find profile option values
- Query to get details of concurrent program parameters
- PL-SQL Code to find Menu Hierarchy of a responsibility
- Query to find details of Flex value sets
- Query to find concurrent program Responsibility and Request Group
- Concurrent program SQL statement currently running in background
- Query to find scheduled concurrent programs
- Query to kill database session for a concurrent request
- Query to get DFF (Descriptive Flex Field) Details