C H A P T E R 1 |
Getting Started |
This chapter explains what you must do before starting the Forte for Java, Community Edition tutorial. For your convenience, it duplicates some installation information from the Forte for Java 4 Getting Started Guide. The topics covered in this chapter are:
Note - There are several references in this book to the CDShopCart application files. These files include a completed version of the tutorial application, a Readme file describing how to run the completed application, and several versions of the SQL script for creating the required database table. These files are compressed into a ZIP file you can download from the Forte for Java 4 Developer Resources portal at http://forte.sun.com/ffj/documentation/tutorialsandexamples.html |
This section describes how to prepare your system before starting the Forte for Java 4, Community Edition tutorial. This means making sure you have everything required to run the Forte for Java 4 integrated development environment (IDE), as well as what is required to create and run the tutorial.
You can access general system requirements from the release notes or from the Forte for Java Developer Resources portal's Documentation page at http://forte.sun.com/ffj/documentation/.
The Forte for Java 4 IDE requires the Java 2 Platform, Standard Edition (the Java 2 SDK). When you install the IDE, the installer searches your system for the Java 2 SDK software and will notify you and stop the installation if the correct version is not installed on your system. You can download the correct version of the Java 2 SDK from the Java Developer's portal at http://java.sun.com/j2se/.
You need the following items to create and run the tutorial. Some of these items are included in the default installation of Forte for Java 4, Community Edition. For the supported versions of these products, see the release notes on the following web site: http://forte.sun.com/ffj/documentation/index.html
Start the Forte for Java 4 IDE by running the program executable, as described in the following sections, and more fully in the Forte for Java 4 Getting Started Guide.
After installation, a runide.sh script is in forte4j-home/bin directory. Launch this script by typing the following in a terminal window:
$ sh runide.sh |
For ways to customize this script, see Modifying the Session With Command-Line Switches.
After installation, start the IDE in one of the following ways:
Double-click the Forte for Java 4.0 CE icon on your desktop.
This runs the runidew.exe executable, which launches the IDE without a console window. This executable exists in the forte4j-home\bin directory, along with an alternative executable--runide.exe. The runide.exe icon launches the IDE with a console window that includes standard error and standard output from the IDE. On the console, you can press Ctrl-Break to get a list of running threads or Ctrl-C to immediately terminate the program.
Choose Start
Programs
Forte for Java 4.0 CE
Forte for Java CE.
Run any of the executables from the command line.
C:\> runide.exe [switch] |
See the next section for information on switches.
TABLE 1-1 describes the switches that you can use to modify how you launch the IDE. This information is also available from the Forte for Java 4 Getting Started Guide, but is provided here for your convenience.
The Forte for Java 4 IDE stores your individual projects, samples, and IDE settings in your own special directory. This enables individual developers to synchronize their development activities, while keeping their own personal work and preferences separate.
When you install the Forte for Java 4 software, the subdirectories described in TABLE 1-2 are included in your installation directory.
When you launch the Forte for Java 4 software, the subdirectories in TABLE 1-3 are installed in your user settings directory. Most of them correspond to subdirectories in the Forte for Java 4 home directory, and are used to hold your settings.
The CDShopCart tutorial uses the Tomcat 4.0 web server. This server is installed and set as the default web server by the Forte for Java 4 installer. However, you should verify that Tomcat is the default server before you test or run the CDShopCart application.
To verify that the Tomcat web server is the default server:
1. In the Forte for Java 4 IDE, click the Explorer's Runtime tab.
2. Expand the Server Registry node and its Default Servers subnode.
a. Right-click the default web server node and choose Set Default Server.
The Select Default Web Server dialog box is displayed.
b. Select the correct server and click OK.
Before you start the Forte for Java 4, Community Edition tutorial, you must create and install a database table. Instructions in this section describe how to install the table in a PointBase database. If you wish to use a different database program, other versions of the tutorial SQL script are provided in Appendix B.
Alternatively, files containing the SQL script are included in the zip file of the tutorial source code, which you can download from the Forte for Java Developer Resources portal at:
http://forte.sun.com/ffj/documentation/tutorialsandexamples.html
TABLE 1-4 identifies the four available SQL script files.
Creates and populates the table used by the tutorial in PointBase SQL format. Contents are in Script for a PointBase Database. |
|
Creates and populates the table used by the tutorial in Oracle SQL format. Contents are in Script for an Oracle Database. |
|
Creates and populates the table used by the tutorial in Microsoft SQLServer SQL format. Contents are in Script for a Microsoft SQLServer Database. |
|
Creates and populates the table used by the tutorial in IBM DB2 SQL format. Contents are in Script for an IBM DB2 Database. |
The CDCatalog script creates the database schema shown in TABLE 1-5.
The CD table is populated with the records shown in TABLE 1-6.
First create a tutorial database and load the table into it. (If you prefer, you can install the table in any PointBase database you choose.)
Note - If you have already started the Forte for Java IDE, you can either leave it running while you create your database tables, or quit and restart after you finish. |
To create the tutorial database table:
1. Start the PointBase Server.
2. Start the PointBase Console.
3. Change the word sample at the end of the URL field to cdshopcart, as shown.
4. Set the Create New Database option and click OK.
The PointBase Console is displayed. Wait until the status message ending in "Ready" is displayed before proceeding.
5. Copy the PointBase script from Script for a PointBase Database and paste it into the SQL entry window of the Console.
Alternatively, if you have the CDCatalog_pb.sql file from the tutorial source zip file, do this:
a. Choose File Open to display the file browser dialog box.
b. Use the file browser to find the CDCatalog_pb.sql file and click Open.
The message window confirms that the script was executed. (Ignore the initial messages beginning "Cannot find the table..." These appear because there is a DROP statements for the table, which has not been created yet. This DROP statement will be useful in the future if you want to rerun the script to initialize the table.)
Two database files are created in the forte4j-home/pointbase/databases directory.
7. Test that you have created the table by clearing the SQL entry window (Window Clear Input) and typing:
SELECT * FROM CD; |
Your console should display the CD table.
Note - If your display does not look like this table, choose Window |
Copyright © 2002, Sun Microsystems, Inc. All rights reserved.