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.
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.