Set up the data source (JNDI) in WebSphere Application Server
- The assumptions are:
- DB2 is running and you have created a sample database to test with it. In this case, you are using the sample database that comes with the DB2 product. If the sample database does not exist, you may run the "DB2 First Steps" to create it.
- The WebSphere Application Server V7.0 – ProcessCenter01 service is started.
- In a web browser, bring up the WebSphere Administrative Console.
https://localhost:9043/ibm/console/logon.jsp. The port number may be different in your environment. You can look in the
<WLE_HOME>/AppServer/profiles/Lombardi/logs/ProcessCenter01 Service.logfile to determine the port number.
- Log in as
tw_useras shown in Figure 47. The password is
Figure 47. WebSphere Administrative console login
- In the navigation pane, go to Resources > JDBC > Data sources.
- In All scopes, you see five data sources that were created during the product installation. One is the default "Datasource", and the other four are related to Lombardi Teamworks.
- You will create a new data source that points to the sample
- Change the Scope to Cell=LombardiCell01.
- Click New.
- Enter a data source name, such as
SampleDB Data Source.
- Enter a JNDI name, such as
jdbc/sampleDB(Figure 48) and click Next.
Figure 48. Data source information
- You may choose to create a new Java™ Database Connectivity (JDBC) provider. Since one already exists for DB2, select an existing JDBC provider.
- Click Select an existing JDBC Provider. From
the drop down list, select TeamWorks Process Server
DB2 JDBC Driver as shown in Figure 49 and click
Figure 49. Select the JDBC provider
- For the driver type, choose 4.
- Enter the database name as
- Enter the database server name as
- If the port number is not filled in, enter the database port
number as shown in Figure 50. The default port number for DB2
- Click Next.
Note: In production environments, we recommend that you use a fully qualified host name rather than a localhost.
Figure 50. Database properties
- Choose the LombardiCell01/processdblogon alias for all (Figure 51), except the mapping-configuration alias.
- Click Next.
Note: Typically, you create a J2C authentication alias. Since you are simply using a different database table in the same DB2 instance, you can use the existing J2C aliases.
Figure 51. Security settings
- On the Summary screen, double-check the values and click
Finish, as shown in Figure 52.
Figure 52. Data source creation summary
- Save to the master configuration and restart the server.
- Select the newly created data source and click the Test connection button. Make sure the connection is successful. If there are errors, fix them before proceeding.
- We need to add user and password to this JNDI. In the data source
page, click on the link Sample Data Source Name,
as shown in Figure 53.
Figure 53. Data sources
- In the new window, click on Custom properties as
shown in Figure 54.
Figure 54. Custom properties
- Click on the New button as shown in Figure
Figure 55. Create a new property in Custom properties
userin the Name text field (Figure 56). Fill your DB2 user value in the Value text field. We used
db2adminin this tutorial. Click Apply.
Figure 56. Create a new property
After this step, you have one property with a DB2 user name.
- You need to create another property containing the password as
well (Figure 57).
Figure 57. Create another new property
- Click on OK.
- Double check the overall Custom properties and
click Save. The new properties are shown in
Figure 58. New properties are displayed
- Test the connection and you see a message similar to the one shown
in Figure 59.
Figure 59. Testing the connection
Now you have a JNDI ready to be retrieved.