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!

Basil Bourque
11.3k20 gold badges63 silver badges96 bronze badges
asked Sep 2, 2015 at 7:31

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"

answered Sep 2, 2015 at 8:49
2
  • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well? 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 Commented Sep 2, 2015 at 9:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.