Preparing for the Online Auction sample application
(UML visualization for J2EE - Technical Preview Edition)

To build the Online Auction sample application, you need to ensure that all system prerequisites are met and that the development and run-time environments are correctly installed and configured.

System prerequisites

The hardware and operating system prerequisites for building and running the Online Auction sample application are the same as those that are specified for the WebSphere Studio product. This scenario was originally developed for WebSphere Studio Application Developer and has been updated to incorporate the Unified Modeling Language visualization capabilities for EJBs and for Java. The instructions provided here should work for other WebSphere Studio product configurations that include the EJB tools.

In addition to WebSphere Studio and its prerequisites, you need the following software in order to build and run the Online Auction sample application :

For Windows

For Linux

The optional software is as follows:

Setting up the development and run-time environments

In preparation for building and running the Online Auction sample application, you need to perform the following activities, which are described in the sections that follow.

Install and configure the CVS server (optional)

In this section, you get some tips on how to install the CVS server and set up the repository for team development. The installation of CVS is optional for the sample application, but there are sections in the sample application instructions that explain how to use it with WebSphere Studio for team programming. You can download a free copy of CVS from www.cvshome.org.

To install and configure the CVS server:

  1. Install the CVS product using the product ZIP file. If you are planning to use it for production purposes, it is recommended that you install the product on a Linux server.
  2. Add the repository (or repositories) by creating a directory and running the cvs init command.
  3. Authorize the users. It is recommended that you use an SSH connection method and create a user ID on the server for each developer.
  4. Configure the server to run the SSH daemon by default.

More detailed information about installing, configuring, and using the CVS server can be found in the CVS manual and in articles located on the WebSphere Developer Domain.

Install WebSphere Studio

Install WebSphere Studio using the installation instructions that accompany the product.

In this section, you perform the following activities:

 

To customize the J2EE perspective to include UML class diagrams on the File > New submenu

Install DB2 and run the DB2 script to create the database tables

In this section, you perform the following activities:

WebSphere Studio includes a copy of DB2 UDB Personal Edition. You can also download a free copy of DB2 UDB Personal Edition from www.ibm.com/software/data/db2.

To enable the JDBC 2.0 driver and create the database:

  1. For Windows If DB2 is not already installed, install it by running the DB2 installation program.

    For Linux Run the DB2 install program and select the Create a DB2 instance option, then accept the default user name db2inst1 and accept all remaining default values in the install program.

  2. For Linux Login as user db2inst1 by issuing the following command: su - db2inst1
  3. Change your DB2 installation to use JDBC 2.0 by completing the following steps:

    For Windows

    1. Open a DB2 command window (Start > Programs > IBM DB2 > Command Window), then navigate to DB2_installdir\SQLLIB\java12 (where DB2_installdir is the installation path of DB2).
    2. Stop all DB2 services and make a note of the services you stopped, then run the following command to change your database installation to use JDBC 2.0: usejdbc2.bat
    3. Restart the services that you stopped, then in a DB2 command window, issue the following command to ensure the essential DB2 processes are running: db2start.

    For Linux

    1. Navigate to the following directory: /home/db2inst1
    2. Edit the file .bashrc and add the following lines of code to the bottom of the file:

      if [ -f /home/db2inst1/sqllib/java12/usejdbc2 ]; then
         . /home/db2inst1/sqllib/java12/usejdbc2
      fi
      
    3. Save and close the file.
    4. Issue the following command: source ./.bashrc
  4. Create the DB2 UDB SAMPLE database (if not already created) by completing the following steps:

    For Windows

    1. Select Start > Programs > IBM DB2 > First Steps.
    2. Click Create Sample Databases.
    3. Select the DB2 UDB Sample check box and click OK. (Note that if you created the sample database previously, the check box will be cleared.)
    4. When a message box indicates that the database has been created, click OK and close the First Steps wizard.
    5. If you would rather create a new database than use the DB2 UDB Sample database, then edit the crtOnlineItems.sql script and follow the instructions in the comment sections.
    6. In a DB2 command window, navigate to the following directory (where WS_installdir is the path where you have installed WebSphere Studio): WS_installdir\samples\scenario_parts\auction
    7. In a DB2 command window, run the script by issuing the following command: db2 -tf crtOnlineItems.sql This creates the required tables and populates them with some test data.
    8. Close the DB2 command window.

    For Linux

    1. Issue the following command: db2sampl
    2. In the command window, navigate to the following directory: /opt/IBM/WebSphereStudio/samples/scenario_parts/auction
    3. If you would rather create a new database than use the DB2 UDB Sample database, then edit the crtOnlineItems.sql script and follow the instructions in the comment sections.
    4. In a command window, run the script by issuing the following command: db2 -tf crtOnlineItems.sql This creates the required tables and populates them with some test data.
  5. For Linux Complete the following steps:
    1. Exit from user db2inst1.
    2. To ensure that the correct database libraries are accessible, complete the following steps:
      1. Navigate to the home directory. For example: /home/user_name
      2. Edit the file .bashrc and add the following lines of code to the bottom of the file:

        if [ -f /home/db2inst1/sqllib/db2profile ]; then
           . /home/db2inst1/sqllib/db2profile
        fi
               
        if [ -f /home/db2inst1/sqllib/java12/usejdbc2 ]; then
           . /home/db2inst1/sqllib/java12/usejdbc2
        fi
        
      3. Save and close the file.
      4. Issue the following command from the home directory: source ./.bashrc
    3. Exit from WebSphere Studio and then open WebSphere Studio again to pick up the environment changes.