Cloudscape Basics and the Sample Database
Page 3 of 6

Getting to Know Your System Directory

When an application creates a database, Cloudscape puts the database (a directory that holds several files) in what is known as the system directory.

The system directory is by default the current directory--whatever directory you happen to be working in. This means that when you run an application that creates a database, that database will be created in the current directory. And when you run an application that interacts with an existing database, it expects the database to be in the current directory.

The system directory also holds the information log (cloudscape.LOG), which is generated whenever an application interacts with a Cloudscape database.

It is a good idea to specify the system directory instead of letting Cloudscape assume the default directory. That way, your applications will work no matter where you run them.

In this section, you will create a system directory so that you can specify the system directory later. Your databases will be built in this directory. You will also create a working directory. This is the directory from which you will run scripts and Java programs. This section includes the following tasks:

Create a System Directory for the Tutorial

Create a system directory for the tutorial anywhere on your hard disk. Call it tutorial_system. This directory will contain the databases that you create in this tutorial as well as the information log and the properties file.

You will refer to the system directory on the command line when you run CreateToursDB later. You will need to specify the full path to the directory. For example, if you created the directory on C:\, you will refer to the system directory as:

c:\tutorial_system

The remainder of this tutorial refers to the complete path to your system directory as your_tutorial_system.

Create a Home or Working Directory for the Tutorial

  1. Create a home or working directory for the tutorial activities now anywhere on your hard disk. Call it tutorial_home.

    The home directory will be your home base for doing command-line activities in this tutorial. In other words, unless otherwise directed, issue all commands from this directory.

    The remainder of this tutorial refers to the complete path to your working directory as your_tutorial_home.

  2. /demo/programs/tours contains a subdirectory called scripts. Copy all the files in scripts (not the directory itself) to your working directory. These files should be directly inside the working directory.

    Having copies of these files in the home directory will make it easier to work with these files and will allow you to leave a "clean" copy in the original directory in case you want to start over later.

Make Sure Your PATH Variable Is Correct

The PATH variable enables your operating system to find the appropriate executables from any directory. You must have the path to the JDK that you wish to use in the PATH variable. See the installation instructions that came with your JDK for information on how to set PATH.

Customize Your setclasspath Script

The files that you copied over from the scripts directory include three sample script files with the command to set the CLASSPATH environment variable.

The file name and command depend on your operating system.

  1. Open the appropriate file from the your_tutorial_home directory.
    • Windows users should open setclasspath.bat.
    • UNIX users should open setclasspath.sh.
    • UNIX users who are working in cshell should open setclasspath.csh
  2. Alter the script to set CLASSPATH to what you determined it should be in Determine Your Class Path. For example, you may need to change the path of the cloudscape base directory.

Running the Script

Later in this tutorial, you will be asked to run this script. Here's how you do that:

  1. On Windows:

    setclasspath

    On Windows 95, if you get an "out of environment space" error, you need to enlarge the environment space. See Appendix A, "Troubleshooting Common Problems", for more information.

  2. On Sun Solaris csh:

    source setclasspath.csh

  3. On sh or ksh:

    . setclasspath.sh

Directory Review

By the time you get here, you should have created two directories:

  • your home or working directory ( your_tutorial_home)

    This is the directory from which you will run scripts and Java programs.

  • your system directory, ( your_tutorial_system)

    This directory will contain two databases that you will create in this lesson.

Figure 2-2 shows the basic layout of the two directories plus the cloudscape base directory.

Figure 2-2 The layout of three directories: your working directory (home to your scripts and Java programs), your system directory (home to your databases, information log, and properties files), and the cloudscape base directory (which is the value of the CLOUDSCAPE_INSTALL environment variable).