File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Oracle/OAS and the fly likes Using loadjava in Oracle 9i Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Using loadjava in Oracle 9i" Watch "Using loadjava in Oracle 9i" New topic

Using loadjava in Oracle 9i

Chris Staten
Ranch Hand

Joined: Sep 24, 2004
Posts: 101
Hey all, I have a quick question about java and Oracle 9i. I�m using Oracle�s loadjava utility to load java classes into my database and then calling them using PL/SQL. I read where the loadjava utility works with .java, .class, and .jar files, so I decided to compile all of my code and jar it up before moving it over to the database (seems cleaner to me).

This is where I run into a problem, all of my classes seem to have errors in them when I do this, but if I take the .java files and move them over using the loadjava utility then they compile just fine and all is good.

Any idea why my code only works when the source code is moved over?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

I'm moving this to our Oracle forum since it is about an Oracle utility.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Chris Staten
Ranch Hand

Joined: Sep 24, 2004
Posts: 101
OK, I've got everything working just fine by jaring up the .java files and not the .class files. They get compiled and loaded into the DB just fine when I move the jar file over.

I'd still like to figure out why I can't directly put my class files over though.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1141

Either don't use the "-resolve" option (in your loadjava command line) or add the "-genmissing" option. The loadjava utility is described in the Java Developer's Guide which is part of the Oracle documentation and is available from:

Good Luck,
I agree. Here's the link:
subject: Using loadjava in Oracle 9i
It's not a secret anymore!