4

I'm a little stuck here with my Java Source. First I want completly drop it from the database, because I want to recompile it, but I can't drop is, because if I execute this command:

drop java source "SCHEMA.JAVASOURCENAME";

I get this error:

ORA-04043: object JAVASOURCENAME does not exist

The Javasource itself has this structure (this is the plsql/java code for it):

create or replace and compile java source named myjavasource as

import java.io.*;
import some.custom.jar.one.*;
import some.custom.jar.two.*;
import some.custom.jar.three.*;

    public class MyJavaClass
    {
      public static String myjavafunction(String connectString, String identity, String password)
      {
       ...
      }
    }

I executed this "create or replace and compile java source..." command as DBA and with my user as well, I don't know if this can be the problem.

So my question is, how can I drop this java source?

My second question is who can I handle the custom jars? I imported them with this command:

call dbms_java.loadjava('-genmissing -r -v -force -grant SCHEMA ./some.custom.jar.one.jar');

I also executed this as DBA and with my user. If is check the invalid objects:

SELECT *
    FROM user_objects
    WHERE object_type like '%JAVA%'
    AND status = 'INVALID'

as DBA I see the whole world invalid (lot of Java classes), but when I check this as user I only get the javasource and the java class name in the invalid list (I think it needs some more external jars, what I can't find right now).

So, why is the invalid java object list different as DBA and as user? Do I need to execute the Java source creation and the jar imports as DBA (and ONLY with DBA), or with the database user if I want to use it (the java funtion, what is using the external jars) with all schema users?

Thank you very much!

1 Answer 1

6

Each element of a name must be quoted individually:

drop java source "SCHEMA"."JAVASOURCENAME";

The identifier "SCHEMA.JAVASOURCENAME" refers to a java source name SCHEMA.JAVASOURCENAME in the current schema, e.g. "VORIAND"."SCHEMA.JAVASOURCENAME"

2
  • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?
    – VORiAND
    Commented Sep 2, 2015 at 8:53
  • @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea
    – user1822
    Commented Sep 2, 2015 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.