wood burning stoves 2.0*
The moose likes JDBC and the fly likes jdbc driver not found while using applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc driver not found while using applet" Watch "jdbc driver not found while using applet" New topic
Author

jdbc driver not found while using applet

deb platt
Ranch Hand

Joined: Jan 23, 2008
Posts: 44
I am porting an intranet webapp that consists of servlets and applets. Both the servlets and applets interface with an Oracle8 rdms. Originally the servlets were compiled with Java 1.2 and the applets were compiled with Java 1.4, and the webapp was hosted on a Netscape4 server. I am now compiling both the servlets and applets using Java 1.5, and the webapp is being hosted on Tomcat6. The ported servlets are interfacing successfully with the database, but I keep getting "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver" when I try to use the ported applets that interface with the database.

I am under the impression that the driver has to be part of the same jar that the applets are in (applet.jar). I am also under the impression that I should be using the JDBC driver that corresponds to the release of javac that I'm using. So I downloaded ojdbc5.jar. I had read elsewhere that applet.jar should be uncompressed, so I extracted the contents of ojdbc5.jar into the applet directory, and then used jar -c0f to make an uncompressed applet.jar. I can do a jar -tf and see that oracle.jdbc.driver.OracleDriver is present in applet.jar. However when I upload the webapp to Tomcat and try to use the applets, I get the ClassNotFoundException with respect to OracleDriver.

Any suggestions would be most appreciated.

Deb
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
You don't need to extract the contents of the ojdbc5.jar file. Let's suppose that there is a jars directory under the directory where the HTML files reside. If the ojdbc5.jar were placed in the jars directory, then the archive attribute of the applet tag would look like this.



SCJP 1.4, SCWCD 1.3, SCBCD 1.3
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jdbc driver not found while using applet
 
Similar Threads
Unsupported feature
Connecting to an Oracle DB
Connecting Java Application with a Database
JDBC and Linux
problem with classpath