Adding a Database

The SilverStream Application Server uses databases to store your applications. Before deploying a J2EE application, you need to add a database to the server to store the application.

NOTE   This document is for developers of J2EE applications. If you are developing classic SilverStream applications, see the Classic Development Help for information about using the Designer to add databases to the server.

This document describes the following:

    For information on setting up a database for use with SilverStream, see the Installation Guide.

 
Top of page

Adding a database to the server

You use the Add Database utility to add a database to a SilverStream server.

NOTE   In UNIX, this utility runs using a GUI and cannot be run in a character terminal window. If you log in remotely to the UNIX machine, make sure you set your DISPLAY environment variable appropriately.

To add a database to a SilverStream server:

  1. Start your server.

  2. Start the utility in one of the following ways:

    You are prompted to specify a server.

  3. Specify server:port, where:

    Item

    Description

    server

    The name of the server (such as localhost or http://hostname).

    port

    The administration port. You need to specify the port only if it is not the default port (port 80).

        For more information about ports used by the server, see Setting up separate ports in the Administrator's Guide.

  4. Click OK.

    You are prompted to log in.

  5. If your server has restricted access (that is, requires authentication), specify the administrator's user name and password (specified during server installation) and click OK. If your server is unrestricted, you can click Cancel to continue.

    You are prompted to enter information about the database.

  6. Use the table below to enter the information for the database. If you need help, see the chapter that covers your DBMS in the Installation Guide.

    Field

    Entry

    Name of the database

    Enter the name of the database. For an ODBC database, the database name must be an already existing ODBC data source name.

    User name and password

    Enter a user name and password pair that the SilverStream server can use for a database user connection to your native database. These values cannot be null.

    This user name must already be known to the native database and have the appropriate read/write permissions.

    NOTE   Your administrator should have defined a unique "user" for each application database (all users can have the same password). For more information, see the chapter on database configuration in the Administrator's Guide.

    Database platform

    Choose from the list of supported database platforms.

    Driver set

    Choose the driver set to use from the list (a driver set is a JDBC driver, sometimes in combination with SilverStream-specific files).

    The listed driver sets are specific to the database platform you selected. The driver set recommended for your database type is displayed by default.

    If you select a non-SilverStream driver set (that is, a driver set whose name does not begin with SilverStream), then see Using non-SilverStream driver sets.

    Store system tables separately from data tables

    If you plan to use a production database that other applications access, you may not want to add SilverStream system tables to it. The system tables contain the objects that comprise your application, that is, the J2EE archives.

    This option allows you to store the SilverStream system tables in another database. If you check this option and click Next a dialog displays asking you to name the system table database. (This database must already exist.)

    Include only a subset of tables

    You might not want to use all the tables in the database you are adding. By selecting this option, you can specify a subset of tables to make available on the server.

    If you select this option and click Next, a dialog displays with two list boxes. In the top box, you can manually name each table you want to use. In the lower box, you can specify patterns to indicate sets of tables. For example, you could specify cust% to use all tables starting with cust.

    You can later change which tables are available using the ModifyTableList SilverCmd.

  7. Click Finish.

    The database is added to the server.

Using non-SilverStream driver sets   If you are not using a SilverStream driver set, you must supply additional information.

The following describes each of the fields on this dialog.

Field

Entry

JDBC Driver

(Read-only) The fully qualified name of your JDBC driver class. For example:

  com.sybase.jdbc.SybDriver

NOTE   Package names, like all Java names, are case-sensitive.

JDBC URL

The URL string defined by the driver vendor to connect to your database. The string contains replaceable parameters surrounded by percent signs (%), such as %HOST%.

For example:

  jdbc:sybase:Tds:%HOST%:%PORT%/%DATABASE%

Substitute these parameters with values appropriate to your database.

JDBC URL attributes

Any additional URL attributes defined by the vendor that you can use to customize the driver connection. For example:

  cache=100

Leave this field empty for DB2 databases.

    See your JDBC driver documentation for more details.

What happens   When you add a database, SilverStream adds an entry in the SilverMaster database and also adds SilverStream system tables to your database (unless you specified to keep system tables separate from your data, in which case, the system tables are added to the other database).

You can use the SilverStream Management Console to see which databases are on the server. For more information, see the Administrator's Guide.

Storing system tables separately from the data   If you are storing the SilverStream system tables separately from the data, SilverStream will store all the application components (the J2EE application archives) in the specified system database.

After adding the database, SilverStream manages the system database transparently. You work only with the main database. For example, if you added Database A to the server and specified to store the system tables in Database B, when you are ready to deploy your J2EE application, you deploy it to Database A.

Adding a database from the command line   You can also add a database to the server from the command line or from a batch file using the AddDatabase SilverCmd.

Deploying a J2EE application   When you are ready to deploy your J2EE application, see J2EE Archive Deployment in the Facilities Guide.

 
Top of page

Removing a database from the server

If you don't need to maintain a connection between a database and the SilverStream server, you can remove the connection using the RemoveDatabase SilverCmd.

When you remove a database connection from the server, SilverStream removes the entry from SilverMaster but leaves the database itself fully intact (including the SilverStream system tables).


Copyright © 2001, SilverStream Software, Inc. All rights reserved.