224 Migrating from WebSphere Application Server Community Edition to WebSphere Application Server
7.3.2 Creating users for database access
The Adventure Builder application uses two users with the user names adventure
and
adventurebuilder to access the database. To create new user accounts, use
the net user Windows command. Follow these steps:
1. Open a Command Prompt window.
2. To create the adventure account with the user ID
adventure and the password
adventure, enter the following command:
net user adventure * /add
3. At the “Type a password for the user” prompt, enter adventure.
4. At the “Retype the password to confirm” prompt, re-enter the password. A
message displays when the command completes successfully. This step
completes the creation of the user
adventure.
5. Similarly, create the
adventurebuilder user with the user ID adventurebuilder
and the password
adventurebuilder.
7.3.3 Database, data sources, and JMS resources
In this section, we discuss the steps to create a database, data sources, JMS
Queue Connection Factories, and queues.
Adventure Builder database
Adventure Builder database uses tables under two schema names, namely
ADVENTURE and ADVENTUREBUILDER. The SQL scripts necessary to create
the database tables are provided under <adventure_src>\src\SG247433\sql. Use
the following steps to create the Adventure Builder database:
1. Launch a DB2 CLP (Command Line Processor) by running the db2cmd
command using Start Run.
2. Change the directory to <adventure_src>\src\SG247433\sql. Execute the
following commands:
db2 create db ADVNTRDB
db2 connect to ADVNTRDB user db2admin using db2admin
db2 -tvf adventure-catalog.sql
db2 -tvf adventure-builder.sql
db2 -tvf grant-permissions.sql
These commands create the database and tables, populate the database
with sample data, and grant necessary user permissions to the tables.
Chapter 7. Developing the application on WebSphere Application Server Community Edition 225
Creating new connection pools and data sources
The ConsumerWebsite uses a data source jdbc/CatalogDB to access the tables
in the ADVENTURE schema. The five EJB applications use a data source
jdbc/adventure/AdventureDB to access the tables in the ADVENTUREBUILDER
schema.
Create the jdbc/CatalogDB data source using the following steps:
1. If the server is not started, start the WebSphere Application Server
Community Edition server by clicking Start All Programs IBM
WebSphere Application Server Community Edition Start the
server.
2. Point your Web browser to http://localhost:8080/console to open the
Community Edition Administrative Console login page.
3. Enter the user name and password (
system and manager by default) to open
up the Administrative Console as shown in the Figure 7-1.
Figure 7-1 Administrative Console
226 Migrating from WebSphere Application Server Community Edition to WebSphere Application Server
4. Click Database Pools in the left navigation pane to open the database pools
page as shown in Figure 7-2.
Figure 7-2 Administrative Console - Database Pools
Chapter 7. Developing the application on WebSphere Application Server Community Edition 227
5. In the Database Pools page of the Create a new database pool section, click
Using the Geronimo database pool wizard to open the wizard for creating
a database pool as shown in Figure 7-3.
6. Complete the following fields for Database Pool:
Name of Database Pool: CatalogDB
Database Type: DB2
Figure 7-3 Administrative Console - Create Database Pool
228 Migrating from WebSphere Application Server Community Edition to WebSphere Application Server
7. Click Next to open a window similar to Figure 7-4.
Figure 7-4 Create Database Pool - Driver Configuration

Get Migrating from WebSphere Application Server Community Edition to WebSphere Application Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.