Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are java classes stored in Oracle?

Where is the java bytecode for loaded java classes stored within an oracle database? Specifically, is there a view or table I can use to obtain the raw bytes for java class schema objects within Oracle?

like image 295
thecoop Avatar asked Mar 18 '09 11:03

thecoop


People also ask

What are Oracle Java classes?

Instances of the class Class represent classes and interfaces in a running Java application. An enum is a kind of class and an annotation is a kind of interface. Every array also belongs to a class that is reflected as a Class object that is shared by all arrays with the same element type and number of dimensions.

Where is Loadjava located?

The loadjava tool is located in the bin directory under $ORACLE_HOME .

What is Java stored procedure in Oracle?

A Java Stored Procedure is a procedure coded in Java (as opposed to PL/SQL) and stored in the Oracle database. Java Stored procedures are executed by the database JVM in database memory space. Java Stored Procedures can be developed in JDBC or SQLJ. Interfacing between PL/SQL and Java are extremely easy.


2 Answers

If you have used CREATE JAVA SOURCE command to load the Java Source into the Oracle database then you can go to the data dictionary view USER_SOURCE and find your Java Source.

If you need to display it or something, you can check out DBMS_JAVA.EXPORT_SOURCE which puts the source code in PL/SQL structures that you can manipulate.

Generally, if you want to just list all Java related stored objects you can execute the following:

SELECT
  object_name, 
  object_type, 
  status, 
  timestamp
FROM 
  user_objects
WHERE 
  (object_name NOT LIKE 'SYS_%' AND 
   object_name NOT LIKE 'CREATE$%' AND 
   object_name NOT LIKE 'JAVA$%' AND 
   object_name NOT LIKE 'LOADLOB%') AND
  object_type LIKE 'JAVA %'
ORDER BY
  object_type, 
  object_name;
like image 95
Petros Avatar answered Oct 08 '22 03:10

Petros


Java bytecode stored in IDL_UB1$ table:

select o.NAME, i.PIECE 
from obj$ o, IDL_UB1$ i 
where o.type# = 29 
    and o.obj# = i.obj#
like image 21
Darmen Avatar answered Oct 08 '22 04:10

Darmen