![]()
14.1.1 Creating the Plants by WebSphere DB2 database
The WebSphere samples by default use Cloudscape as the database. However, in this chapter, we will configure Plants by WebSphere to use a DB2 UDB 8.2 database instead.
To set up the DB2 database, make sure you have DB2 installed and running. Then run the following commands:
1. Select Start | Programs | IBM DB2 | Command Line Tools | Command Window.
2. Create the database using the commands in Example 14-1. Example 14-1 Creating the DB2 database
DB2 CREATE DATABASE PLANTS PAGESIZE 16 K D2B CONNECT TO PLANTS USER <user_id> USING <password> DB2 -tvf Table.ddl db2 connect reset
![]()
The Table.ddl file is located in the PlantsByWebSphereEJB\ejbModule\META-INF\backends\DB2UDBNT_V82_1 directory of your Application Server Toolkit workspace. See Creating a new database mapping and schema.
Because the Plants by WebSphere application stores images in the database using a BLOB, we needed a tablespace with a larger pagesize than the default of 4 KB. To specify this as the default when the database was created, we used the PAGESIZE keyword. This is supported on DB2 UDB 8.2.2, also called 8.1 Fix Pack 9, and later. We used DB2 Express 8.2.5