O'Reilly logo

Java Programming with Oracle JDBC by Donald Bales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Packaging Your Applet

After you have written your applet, you’ll want to combine its class files with those from the appropriate Oracle classesXXX.zip file into a single zip or jar file as you did for Example 3-1. This step is necessary because an applet using JDBC is naturally quite complex and contains many classes. Getting to just one file makes things easier to manage. It is also simpler and more efficient to specify just one file in the HTML APPLET tag rather than specify multiple archive files.

Tip

For simplicity’s sake, this discussion on packaging focuses on the use of JDK 1.2. If you are using JDK 1.1, the syntax for using the jar tool to create the jar file will be slightly different. If you use WinZip, the procedure will be the same as it is for JDK 1.2.

A Development Packaging Cycle

During the development stage for an applet, you can begin your packaging effort by simply making a copy of the Oracle classes12.zip file. Give it the name of your archive file but retain the .zip extension. Then add your applet’s class files, uncompressed, to the zip file that you just copied and renamed. Why uncompressed? I actually don’t know. This is an Oracle recommendation. I have used them as compressed class files when I have created a jar file, but I have never done so using a zip file. For example, if you’re going to create a zip file for an applet named TestAppletPolicy, you should follow these steps:

  1. Copy the file classes12.zip to TestAppletPolicy.zip. On a Windows system, you can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required