Databases Reference
In-Depth Information
make contact with a user-selected relationship. The user also is able to contact
others directly via e-mail. The member's contact information is displayed along
with the profile.
A summary of the files we use in the myContacts application is shown in
Ta b l e 3 - 2 .
Table 3-2 Files used in myContacts
Name
Type
Description
index.php
bootstrap
Any call to the main URL calls this bootstrap file
style1.css
CSS
Style sheet for HTML presentation
IndexController.php
Controller
Main controller
AddController.php
Controller
Contains add/delete/update actions
ViewController.php
Controller
Contains navigation/output functions
index.php
View
Initial view of the application
member.php
View
Displays member profile data
searchResult.php
View
Displays search result
view.php
View
Interface to get new user profile data
thanks.php
View
Acknowledgement of successful user action
error.php
View
Displays error messages
Database.php
Adapter
Contains database functions
Let us go ahead and look at the application.
Setting up the database
The database for the myContacts application is fairly simple, because users are
able to add new members and relationships using the application itself. We need
to store user names and passwords in a DB2 table DB2ADMIN.MEMBER . We also
need to create a table required by XCS. You can set up the database for this
application by running the SQL on the DB2 Command Line as shown in
Example 3-23.
Example 3-23 Database setup script
create database contacts using codeset utf-8 territory us;
connect to contacts;
create table db2admin.member(xmlid BIGINT, email VARCHAR(50) NOT NULL
PRIMARY KEY, passwd VARCHAR(10), fname VARCHAR(30), lname VARCHAR(30));
 
Search WWH ::




Custom Search