Creating a directory and copying scripts into the directory

To help you complete this activity, you must create a directory and copy several scripts into the new directory. You will use these scripts to quickly add tables and data to a new Derby database.

Tip: A command prompt appears after each command is run. If an error occurs, verify the syntax and retype the command.
  1. Open a command window and change to a directory where you want to store the files that you create during the self-study tutorial activities.
  2. Create the DERBYTUTOR directory, as shown in the following table. DERBYTUTOR will be your working directory for this activity.
    Table 1. Command to create the DERBYTUTOR directory. This table lists the commands to create the DERBYTUTOR directory on UNIX and Windows systems.
    Operating System Command
    UNIX (Korn Shell)
    mkdir DERBYTUTOR
    Windows
    md DERBYTUTOR
  3. Change to the DERBYTUTOR directory, as shown in the following table.
    Table 1. Command to change to the DERBYTUTOR directory. This table lists the commands to change to the DERBYTUTOR directory on UNIX and Windows systems.
    Operating System Command
    UNIX (Korn Shell)
    cd DERBYTUTOR
    Windows
    cd DERBYTUTOR
  4. Copy the SQL scripts from the JDK demo\db\programs\toursdb subdirectory into the DERBYTUTOR directory, as shown in the following table. You will use these scripts to create tables and add data to a new database, toursdb. See Installing Java DB for information on obtaining the demos.
    Table 1. Command to copy the SQL scripts. This table lists the commands to copy the SQL scripts to the DERBYTUTOR directory on UNIX and Windows systems.
    Operating System Command
    UNIX (Korn Shell)
    cp $JAVA_HOME/demo/db/programs/toursdb/*.sql .
    Windows
    copy %JAVA_HOME%\demo\db\programs\toursdb\*.sql .
    Important: Include the dot (.) at the end of the command so that the files are copied to the correct location.
  5. Verify that the files were copied to the DERBYTUTOR directory, as shown in the following table.
    Table 4. Command to verify that the files were copied. This table lists the commands to verify that the files were copied on UNIX and Windows systems.
    Operating System Command
    UNIX (Korn Shell)
    ls
    Windows
    dir