C H A P T E R 1 |
Getting Started |
This chapter explains what you must do before starting the Sun ONE Studio 4, Community Edition tutorial. For your convenience, it duplicates some installation information from the Sun ONE Studio 4, Community Edition 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 Sun ONE Studio 4 Developer Resources portal at http://forte.sun.com/ffj/documentation/tutorialsandexamples.html |
This section describes how to prepare your system before starting the Sun ONE Studio 4, Community Edition tutorial. This means making sure you have everything required to run the Sun ONE Studio 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 Sun ONE Studio 4 Developer Resources portal's Documentation page at http://forte.sun.com/ffj/documentation/.
The Sun ONE Studio 4 IDE requires the Java 2 Software Development Kit (the J2SE
SDK). When you install the IDE, the installer searches your system for the J2SE 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 J2SE 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 Sun ONE Studio 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 Sun ONE Studio 4 IDE by running the program executable, as described in the following sections, and more fully in the Sun ONE Studio 4, Community Edition Getting Started Guide.
After installation, start the IDE in one of the following ways:
Double-click the Sun ONE Studio 4 CE icon on your desktop.
This runs the runidew.exe executable, which launches the IDE without a console window. This executable exists in the s1studio-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
Sun Microsystems
Sun ONE Studio 4 CE
Sun ONE Studio
Run any of the executables from the command line.
C:\> s1studio-home\bin\runide.exe [switch] |
For information on switches, see Modifying the Session With Command-Line Switches.
After installation, a runide.sh script is in s1studio-home/bin directory. Launch this script by typing the following in a terminal window:
$ sh s1studio-home/bin/runide.sh |
TABLE 1-1 describes the switches that you can use to modify how you launch the IDE. This information is also available from the Sun ONE Studio 4, Community Edition Getting Started Guide, but is provided here for your convenience.
The Sun ONE Studio 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 Sun ONE Studio 4 software, the subdirectories described in TABLE 1-2 are included in your installation directory.
When you launch the Sun ONE Studio 4 software, the subdirectories in TABLE 1-3 are installed in your user settings directory. Most of them correspond to subdirectories in the Sun ONE Studio 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 Sun ONE Studio 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 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 Sun ONE Studio 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 Sun ONE Studio 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.)
To create the tutorial database table:
1. Start the IDE, if you have not already started it.
2. Start the PointBase Server by choosing Tools PointBase Network Server
Start Server.
A PointBase Server dialog box is displayed. Minimize the dialog box window.
3. Start the PointBase Console.
4. Change the word sample at the end of the URL field to cdshopcart, as shown.
5. 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.
6. 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 s1studio-home/pointbase/databases directory.
8. Test that you have created the table by clearing the SQL entry window (Window Clear Input) and typing:
Copyright © 2002, Sun Microsystems, Inc. All rights reserved.