Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Java classes
joker197cinque_at_gmail.com wrote:
> I'm trying to register a java class this way:
>
> CREATE JAVA CLASS USING BFILE (java_dir, 'Agent.class')
>
> where java_dir is a directory created this way:
>
> CREATE DIRECTORY JAVA_DIR AS 'C:\bin';
>
> Executing these 2 commands is succesfully, but when I try to expand
> "Java sources" in PL/SQL Developer or when I query "dba_java_classes" I
> cannot locate Agent.class anywhere...
>
> Also, I'm searching all morning about an example that can show me how
> to process a double array Java output into a oracle collection...just
> getting crazy :-(
>
> Any help much appreciated.
>
> Best regards.
Well, since you are loading a *class* file, no wonder you can't see its *source* in the database. Java sources are only available for classes created right from the source code, not loaded as precompiled class files. Also remember that .class extension is removed from the object name, so you should look for 'Agent' in dba_java_classes, and if it actually belongs to some package, then the whole path will be prepended with dots replaced with slashes (that is, for example, com.mycompany.MyClass will become 'com/mycompany/MyClass'.) This long name can be further reduced if it doesn't fit the 30 characters limit on identifiers. In this case, you may need to use DBMS_JAVA.LONGNAME() function to get full original class name and DBMS_JAVA.SHORTNAME() for the shortened name you will see in the dba_java_classes view.
As of the other question: can you post some code snippet of what you tried so far?
Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com
Received on Tue Dec 05 2006 - 07:22:54 CST