Home > Articles > Web Services > WebSphere

This chapter is from the book

Tutorial Setup

To prepare the environment for the tutorial, you will create a deployment configuration in WebSphere Portlet Factory, create a database and a table in DB2, and create a datasource in WebSphere Application Server.

WebSphere Portlet Factory—Create a Deployment Configuration

A deployment configuration is a set of properties that define your deployment information. An application server is needed for testing the models in the tutorial and you will create a deployment configuration for the application server instance. Your WebSphere Portal installation has two WebSphere Applications Server instances: server1 and WebSphere_Portal. In this section, you will create a deployment configuration for the WebSphere Application Server instance WebSphere_Portal.

  1. Start WebSphere Portlet Factory Designer.
    1. Click Start, All Programs, IBM WebSphere, Portlet Factory, Designer.
    2. Click OK to accept the default workspace folder as shown in Figure 7.4.
    Figure 7.4

    Figure 7.4 Select a workspace

  2. Create a deployment configuration.
    1. Click Window, Preferences as shown in Figure 7.5.
      Figure 7.5

      Figure 7.5 Set preferences

    2. Expand the WebSphere Portlet Factory Designer section and click Deployment as shown in Figure 7.6.
      Figure 7.6

      Figure 7.6 Select deployment preferences

    3. Click Add to create the deployment environment for deploying your projects as shown in Figure 7.7.
      Figure 7.7

      Figure 7.7 Add a deployment configuration

    4. Table 7.1 shows you how to provide inputs for the New Deployment Configuration dialog. Click OK when you are finished with the dialog as shown in Figure 7.8. Make sure the WAS server WebSphere_Portal has been started.

      Table 7.1. Input values for Deployment Configuration dialog

      Parameters

      Values

      Configuration Name

      Enter WAS61 or provide a different name of your choice.

      Description

      Enter WAS 6.1 deployment configuration or provide your own description.

      Server Type

      Select WebSphere Application Server 6.x from the drop-down.

      Installed Applications Dir

      Enter your WebSphere Portal installed directory.

      (Example: C:\IBM\WebSphere\wp_profile\installedApps\portalhost).

      Server Host

      Enter your WebSphere Portal host name.

      (Example: portalhost.ibm.com).

      Server Port

      10040.

      Specify Deployment Credentials

      Select this check box.

      WAS Server for deployment

      Select WebSphere_Portal from the drop-down.

      Admin User

      Enter your WebSphere Portal Administrator user ID.

      Admin Password

      Enter your WebSphere Portal Administrator password.

      Figure 7.8

      Figure 7.8 New Deployment Configuration dialog

    5. A message indicating that the test to connect to the WAS server was successful is shown as in Figure 7.9. Click OK to close the window.
      Figure 7.9

      Figure 7.9 Test connection message

    6. The new deployment configuration has been created successfully as shown in Figure 7.10. Click OK to close the Preferences window.
      Figure 7.10

      Figure 7.10 New deployment configuration successfully created

In this setup step, you have created a deployment configuration for deploying your projects.

DB2—Create a Database and a Table

This is a setup step required by Tutorial 7.2.

  1. Start the DB2 Control Center.
    1. Click Start, All Programs, IBM DB2, DB2COPY1 (Default), General Administration Tools, Control Center.
    2. Advanced view is the default for the Control Center View as shown in Figure 7.11. Simply click OK.
    Figure 7.11

    Figure 7.11 Specify Control Center view

  2. Create a database using the Create Database Wizard.
    1. Right-click All Databases and click Create Database, Standard as shown in Figure 7.12.
      Figure 7.12

      Figure 7.12 Invoke Create Database Wizard

    2. Enter PetDB as the database name, and keep all other defaults as shown in Figure 7.13. Click Finish.
      Figure 7.13

      Figure 7.13 Specify database name

  3. Create a database table using the Create Table Wizard.
    1. After database PetDB is created successfully, you are returned to the Object view. You should be able to see PetDB by expanding All Databases. To invoke the Create Table Wizard, expand PetDB. Then right-click Tables and click Create as shown in Figure 7.14.
      Figure 7.14

      Figure 7.14 Invoke Create Table Wizard

    2. Enter PetTravelCompany as the table name as shown in Figure 7.15. Click Next.
      Figure 7.15

      Figure 7.15 Specify table name

    3. Click Add to add a column to the PetTravelCompany table as shown in Figure 7.16.
      Figure 7.16

      Figure 7.16 Add a column

    4. Enter ID as the column name and select INTEGER from the drop-down for data type as shown in Figure 7.17. Click OK.
      Figure 7.17

      Figure 7.17 Add Column dialog

    5. Use the Add button to add two more columns using the Table 7.2 as inputs.

      Table 7.2. Inputs values for add column dialog

      Column Name

      Data Type

      Length

      Company

      VARCHAR

      50

      Desc

      VARCHAR

      100

    6. PetTravelCompany has three columns added as shown in Figure 7.18. Click Finish.
      Figure 7.18

      Figure 7.18 Column definition

    7. A message indicating that the table creation was successful is shown as in Figure 7.19. Click Close.
      Figure 7.19

      Figure 7.19 Table successfully created

    8. To display the list of tables in the Contents pane, right-click Tables and click Refresh as shown in Figure 7.20. Do you see your newly created table PetTravelCompany in the Contents pane on the right side?
      Figure 7.20

      Figure 7.20 Refresh the list of tables

  4. Add data to a database table.
    1. To add data to the table PetTravelCompany, right-click PETTRAVELCOMPANY and click Open. as shown in Figure 7.21
      Figure 7.21

      Figure 7.21 Open a table

    2. Click Add Row to add a row to the table as shown in Figure 7.22. You will be doing this action four times to add four rows.
      Figure 7.22

      Figure 7.22 Add a row

    3. Use table 7.3 as input when adding the four rows to the table.

      Table 7.3. Input values for Add Rows

      ID

      COMPANY

      DESC

      1

      AA

      Pet travel insurance

      2

      BB

      Pet carrier for dogs

      3

      CC

      Pet friendly accommodation

      4

      DD

      Pet sitting while you travel

    4. When all the rows have been added to the table, click Commit and then Close as shown in Figure 7.23.
Figure 7.23

Figure 7.23 Table content

In this setup step, you have created a database and a table for creating a portlet that accesses a database.

WebSphere Application Server—Create a Datasource

This is a setup step required by Tutorial 7.2.

  1. Log in to WebSphere Application Server administration console.
    1. Start the WebSphere Application Server administration console by opening a browser and entering the uniform resource locator (URL) http://<hostname>:<port_number>/ibm/console, where <hostname> is the fully qualified host name of the machine that is running your WebSphere Portal and <port_number> is the administration console port number. For example, enter http://portalhost.ibm.com:10027/ibm/console
    2. Log in using your administrator user ID and password.
  2. Select the JDBC (Java Database Connectivity) provider.
    1. Expand Resources, JDBC and click JDBC Providers as shown in Figure 7.24.
      Figure 7.24

      Figure 7.24 Go to the list of JDBC providers

    2. Click wpdbJDBC_db2 as shown in Figure 7.25.
    Figure 7.25

    Figure 7.25 Select the JDBC provider for the portal

  3. Create a datasource.

    1. Under Additional Properties, click Data Sources as shown in Figure 7.26.
      Figure 7.26

      Figure 7.26 Go to the list of datasources

    2. To invoke the Create a Data Source Wizard, click New as shown in Figure 7.27. You will be creating a datasource for your database PetDB.
      Figure 7.27

      Figure 7.27 Invoke the Create a New Data Source Wizard

    3. In Step 1 of the Create a Data Source Wizard as shown in Figure 7.28, enter PetDB for the datasource name, jdbc/PetDB for the JNDI name, and select wpdbDSJAASAuth for the authentication alias. Click Next.
      Figure 7.28

      Figure 7.28 Step 1 of the Create a Data Source Wizard

    4. In Step 2 of the Create a Data Source Wizard as shown in Figure 7.29, enter PetDB for the database name and your WebSphere Portal host name for the server name. An example of a host name is portalhost.ibm.com. Click Next.
      Figure 7.29

      Figure 7.29 Step 2 of the Create a Data Source Wizard

    5. In Step 3 of the Create a Data Source Wizard as shown in Figure 7.30, simply review the information. Click Finish.
      Figure 7.30

      Figure 7.30 Step 3 of the Create a Data Source Wizard

    6. Click the Save Directly to the Master Configuration link as shown in Figure 7.31.
      Figure 7.31

      Figure 7.31 Save to master configuration

    In this setup step, you created a datasource for database PetDB.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020