Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Calling Java Method on Server from PL/SQL

Sachin AhujaNov 29 2024

I have EBSR12.2 running & I want to put my Java class on the server.

I want to call this Java class from PL/SQL Package from the database, but facing issue with error message “class does not exists”.

What I did so far is:

  1. Created Java class on the server under JAVA_TOP/custom
  2. Ran "loadjava" command
  3. Ran adcgnjar command
  4. Bounced the instance
  5. Created Function in DB as below

CREATE OR REPLACE FUNCTION getFees RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'XYZgetFee.getFee() return java.lang.String';
/

Now running below anonymous block, where I am getting the error message as “ORA-29540: class XYZgetFee does not exist”

================================

DECLARE

result varchar2(100);

BEGIN

result := getFees;

DBMS_OUTPUT.PUT_LINE('Sum: ' || result);

END;
================================

Please suggest.

Comments

BluShadow Jan 3 2025

Eloqua forums are hosted over on the Cloud Customer Connect community, rather than this Developer Comunity where you have posted…

https://community.oracle.com/customerconnect/

If you're not already registered on Cloud Customer Connect you'll need to sign up (it's free) and when joining, specify what categories you are in interested in participating in.

1 - 1

Post Details

Added on Nov 29 2024
0 comments
144 views