Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    1

    Unanswered: How to execute classes that reside in different user's schema

    I have to load a class in App1 and need to register a Java Stored Procedure in App2. This procedure refers class loaded in App1. Finally the procedure is to be executed from app1 user.

    I am working with oracle database. It has two schemas App1 and App2.

    I have a test class:

    public class myTest {

    public static void test(int a, long b)
    {
    System.out.println("A : "+a);
    System.out.println("B : "+b);
    }
    }

    I have loaded the class in APP1 schema as follow

    loadjava -user app1/app1 -oci8 -resolve –grant app2 myTest.class

    Login to SQLPLUS by App1

    Then created Java Stored procedure in APP2
    CREATE OR REPLACE PROCEDURE APP2.Test( a IN NUMBER, b IN NUMBER) IS LANGUAGE JAVA NAME 'myTest.test(int,long)';



    Now when I call this procedure, it gives error mentioned below

    SQL> Call App2.Test (1, 2);
    ERROR at line 1:
    ORA-29540: class myTest does not exist

    Please suggest me where I am missing out something.

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    I am not very familiar with this kind of Java stuff within the database, but I think 'myTest.test(int,long)' should be 'App1.myTest.test(int,long)', since myTest was created within the App1 schema and you are calling it from the App2 schema.

    Regards,

    rbaraer
    ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •