In a standard JVM I can re-order my classpath to "hide" similar classes (move desired implementation of a class/interface to the front of the classpath). How I can achieve this behaviour in the internal database JVM (e.g. 11g)? Is this the order of loading the classes with "loadjava"?
Asked
Active
Viewed 195 times
0
-
@Florin Ghita: It belongs to Oracle RDMBS, the "loadjava" tool is necessary to load java code into an Oracle DB. So I think, the tag "Oracle" was correct. – witchi Mar 14 '16 at 15:09
-
sorry, I've rolled back the edit. – Florin Ghita Mar 14 '16 at 15:31
1 Answers
0
When you use the loadJava
utility to load a class there is only a single path on the class-path.
If you load a class that has the same name and class path as a previous class then it will ignore the newer class unless you specify the -force
option:
-force
Forces files to be loaded, even if they match digest table entries.
In which case it will overwrite the earlier entry (it will not load two copies of the class).
So, no, you cannot hide duplicate classes by re-ordering the class-path (as you can with external JVMs) as there is only a single path on the class-path within the internal JVM used by Oracle.

MT0
- 143,790
- 11
- 59
- 117
-
Ah, thank you. So I have to order the loadjava calls and have to execute it in the reverse order than it occurs on the classpath. – witchi Mar 14 '16 at 15:11
-
No, you can do it in the order of the class path and not specify the `-force` option. In which case, all later duplicates should be ignored. – MT0 Mar 14 '16 at 15:30