DB2 Database Configuration

Step 1 Step 2 Step 3 Step 4 Step 5


Step 2: Create the SAMPLE Database.

  • Create the SAMPLE database.
    For DB2 on AIX:
    Use DB2's command-line processor and type:
    1. CREATE DATABASE DB2SAMP
    2. Complete instructions to use TCP/IP to connect to DB2 database.


    For all other operating systems:
    There are two methods for creating the SAMPLE database:
    • Run DB2's "First Steps" application
    • Use DB2's command-line processor and type:
      1. CREATE DATABASE SAMPLE

Please see DB2 documentation for more information on GUI or command line options.


Take Note!
  • AIX users will create a database and an alias which connects to the real database via TCP/IP. The real database name is arbitrary -- we use "DB2SAMP" -- but the alias name must be SAMPLE. The extra steps to connect to the DB2 database prevent StaleConnectionExceptions which occur when too many processes try to access the same shared memory.
  • The database will be created in the default location and will be expanded as needed to hold the tables. The "First Steps" utility creates a database named SAMPLE with tables added to it. Alternatively, you can create an empty database with any name you choose. Whatever name you give it, specify the same database name (or, for AIX, the same database alias) in Steps 3 and 4 when you create the corresponding DataSource object.