Generally, the time that it takes for applets to download is determined by the following factors:
• Number of classes that are loaded. Each class that is downloaded results in an HTTP request to your Web server. The more requests and transfers that are made, the slower the download.
• Size of the byte code that is loaded. The more bytes that are transferred, the slower the download.
JDK 1.2-compatible and higher Java Virtual Machines support JAR files, which reduces the number of HTTP requests because all the class files are packaged together in the JAR file. The JAR format also allows you to compress the packaged files, which further optimizes the download.
To reduce download time by using JAR files:
1. Package all classes of your applet into a JAR file.
2. Copy the JAR file into the directory indicated by the codebase tag.
3. Specify the JAR file in the archive tag.
For example:
<html>
<applet
width=100 height=100
code=MyApplet
codebase=.
archive=myapplet.jar>
<param name=ConfigFile value=Config.txt>
</applet>
The JDBC Client is packaged into oajc.jar that contains all classes of the JDBC client.
To use the JDBC Client from within your applet, specify these JAR files in the archive tag as shown: