You cannot create databases on your local machine using client-only software, such as the DB2 Applicaton Development Client. Instead, you have to catalog the database before you can compile, debug or run programs.
With client with local data software, such as DB2 Universal Database Personal Edition, you might need to access remote database for unit testing. Again, you need to catalog the remote database before this can occur.
You can use the GUI tool provided by Host Compatibility Option or one of the utilities provided by IBM such as Client Configuration Assistant to do this.
To display the Catalog Database tool (see Figure 9-1), click HCO > Catalog Database on the Tools menu.
Figure 9-1: Catalog Database Tool
The following elements make up the Catalog Database tool:
The following list shows the buttons in the toolbar and the functions that they invoke:
|Display the Catalog New Database window (see Figure 9-2) to enter information required to catalog a new database.|
|Uncatalog a database. Function is unavailable until a database has been selected from list box. This function only affects databases cataloged on your PC.|
|Test connection to selected database. Function is unavailable until a database has been selected from list box.|
|Switch to Catalog Server tool. See the chapter Catalog Server for more details.|
|Display the on-line HCO User's Guide,which is a hypertext file that describes how the Catalog Database tool works.|
The menu bar is an another way of invoking Catalog Database functions. The menu bar is composed of two menus: Database and Help.
To run a command or to exit the tool, use the Database menu. You can also display this menu by right-clicking on the Catalog Database window (see Figure 9-1).
|Catalog new database||Display the Catalog New Database window (see Figure 9-2) to enter information required to catalog a new database.|
|Uncatalog database||Uncatalog a database. Function is disabled until a database has been selected from list box. This function only affects databases cataloged on your PC.|
|Test connect||Test connection to selected database. Function is disabled until a database has been selected from list box.|
|List servers||Switch to Catalog Server tool. See the chapter Catalog Server for more details.|
|Exit||Exit Catalog Database tool.|
To catalog a database, either click Catalog or select Catalog database from Database menu. A window similar to the Catalog Database window is then displayed (see Figure 9-2).
Figure 9-2: Catalog Database Window
In the entry fields provide the following information:
|Database Name||The name of the database on the database server or the local database name if type is LOCAL.|
|Alias||An alternate name for the database that you want to use (optional) .|
|Comment||A brief description to use to identify the database (30 characters maximum).|
|Drive Letter||Select the drive letter where the database is located. This selection is not required if cataloging a remote database.|
|Type||Select LOCAL for databases on your PC or REMOTE for databases located on a remote database server.|
|Server||Select the remote database server where the database is located. If the server is not listed, you need to use the Catalog Server tool to add the server to the list. (See the chapter Catalog Server for more information) .|
|Authentication||Select location where security is to be performed. This selection must match what is set for database server.|
Then click CATALOG. When the database has been cataloged, the Catalog New Database window is removed and the database is added to list box on Catalog Database tool (see Figure 9-1).
You need one of the following authorization levels to be able to execute this function:
Don't worry if you make a mistake cataloging the database. You can uncatalog the database from the Catalog Database tool by:
You should check to see if you can connect to the database before trying to do application development. You can test connection by doing the following:
If the connect fails, the SQL Error Message tool is displayed with the SQLCODE and error message associated with the connect error. These will aid you in correcting the problem. Make sure that the following has been done:
DB2STARThas been issued.
NET START DB2
NET START DB2NTSECSERVER
Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.