The J2EETM Tutorial

Cloudscape Server

The examples in this manual have been tested with the Cloudscape DBMS, which is included in the J2EE SDK.

Starting Cloudscape

Before your enterprise beans can access a Cloudscape database, you must run the Cloudscape server from the command line:

cloudscape -start

You should see output similar to the following:

Mon Aug 09 11:50:30 PDT 1999: [RmiJdbc]	
COM.cloudscape.core.JDBCDriver registered in DriverManager	
Mon Aug 09 11:50:30 PDT 1999: [RmiJdbc] Binding . . ..	
Mon Aug 09 11:50:30 PDT 1999: [RmiJdbc] No installation of	
RMI Security Manager...	
Mon Aug 09 11:50:31 PDT 1999: [RmiJdbc] RmiJdbcServer	
bound in rmi registry 

Stopping Cloudscape

To stop the server type the following command:

cloudscape -stop

You should see output similar to the following:

Attempting to shutdown RmiJdbc server	
RmiJdbc Server RmiAddr is: //buzz/RmiJdbcServer	
WARNING: Shutdown was successful! 

Note: If you stop the server with Control-c, files will not be closed properly. When the server is started the next time, it must perform recovery by rolling back noncommitted transactions and possibly applying the forward log.

Running the Interactive SQL Tool

The Cloudscape product includes a text-based, interactive tool called ij. (This tool is not supported by Sun Microsystems, Inc.) You can run the ij tool by typing this command:

cloudscape -isql

Within the tool, each command you type must end in a semicolon. The commands in the next example display all rows from the orders table, execute a SQL script named myscript.sql, and end the tool session:

ij> select * from orders;	
ij> run 'myscript.sql';	
ij> exit;

The following example runs a SQL script from the command line:

cloudscape -isql < myscript.sql

This command lists the names of all user tables in the database:

ij> select tablename from sys.systables	
    where tabletype = 'T';

The next example displays the column names of the orders table:

ij> select columnname from sys.syscolumns	
    where referenceid =	
          (select tableid from sys.systables	
           where tablename = 'orders');

Before you deploy an entity bean with container-managed persistence, you use deploytool to generate the bean's SQL statements. Because the table names in these SQL statements are case sensitive, you must enclose them in double quotes:

ij> select * from "TeamBeanTable";

For more information on the ij tool, please refer to the online documentation on the Cloudscape Web site:

Cloudscape Server Configuration

The default database used by the Cloudscape server is named CloudscapeDB. This database will reside in the cloudscape directory of your J2EE SDK installation. The CloudscapeDB database will be created automatically the first time it is accessed. The driver for the Cloudscape server is already configured in the config/ file. No further changes by you are necessary.