3.3.2.2 Cataloging database USERSTUF on the front end server
As will be discussed in 3.5.3,  Accessing DB2 via JDBC  on page 83, the
front end server will use the DB2 native API type 2 JDBC driver to access the
DB2 USERSTUF database. For this to work, we must catalog the USERSTUF
database on our front end server.
We logged in as the DB2 instance owner db2inst1 on the front end server by
issuing the DB2 commands in the following order:
db2 catalog tcpip node bdtest3 remote 9.3.240.221 server 50000
db2 catalog database userstuf at node bdtest3
Verify the connection by connecting to the DB2 database with the command:
db2 connect to userstuf
3.3.2.3 Creating the DB2 tables in the database
We can create the database tables for the USERSTUF table either using the
DB2 Control Center GUI or via the DB2 command line.
We demonstrate how to create the tables using the command line interface.
We have already created four SQL script files to be used for this process (see
Appendix A,  SQL scripts for creating the USERSTUF tables  on page 145).
We demonstrate creating the USERINFO table here. The script file is named
userinfo.ddl, and the contents are shown in Figure 56.
create table userinfo (
first_name varchar(20) not null,
last_name varchar(20) not null,
email_address varchar(50) not null,
date_joined date not null,
birth_date date not null,
address varchar(200) not null,
username varchar(20) not null,
primary key (username)
);
Figure 56. The userinfo.ddl file
The steps to create the USERINFO table are as follows:
1. Log in as the default DB2 instance owner, db2inst1.
2. Connect to the USERSTUF database with the command:
db2 connect to userstuf
68
Linux Web Hosting with WebSphere, DB2, and Domino




  

Home

About Services Network Support FAQ Order Contact
 

Linux Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved