Tuesday, December 10, 2013

Manually creating a data source for the persistent store

If you chose to manually configure WebSphere® Application Server Network Deployment, you must create a data source in order to store JMS messages in a DB2® database.

About this task

You have the option of having WebSphere Application Server Network Deployment use a DB2 database to store JMS messages. For more information about WebSphere Application Server Network Deployment message storage, including the usage of products other than DB2, seehttp://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/tjm0045_.html.
To create a data source for the persistent store, complete the following steps:

Procedure

  1. Create a system user and password on the server hosting the database server. For example, a user named mxsibusr with a password ofmxsibusr.
  2. Create and configure the database.
    1. Open DB2 Control Center.
    2. Browse to the Databases folder listed under your system.
    3. Right-click the Databases folder and select Create Database > Standard.
    4. Create a database named maxsibdb using default settings.
    5. After the database has been created, expand the maxsibdb database and select User and Group objects.
    6. Right-click DB Users and select Add.
    7. Select mxsibusr from the User menu.
    8. Grant all authorities to the mxsibusr except Security administrator authority.
    9. Click Apply.
    10. Verify that you can connect to the database using the mxsibusr user by right-clicking maxsibdb and selecting Connect.
  3. Configure J2C authentication data and JDBC provider in WebSphere Application Server Network Deployment.
    1. Open and login to the WebSphere Application Server Network Deployment administrative console.
    2. Browse to Security > Global Security.
    3. Under the Authentication header, click Java Authentication and Authorization Service > J2C authentication data.
    4. Click New.
    5. Complete the following fields in the User identity form.
      Alias
      maxJaasAlias
      User ID
      mxsibusr
      Password
      Password you created for mxsibusr.
      Description
      SIB database user alias.
    6. Click Apply, and then click Save.
    7. From the WebSphere Application Server administrative console, browse to Resources > JDBC > JDBC Providers.
    8. Under Scope, click Show scope selection drop-down list with the all scopes option, select Cell=ctgCell01, and then, underPreferences, click Apply.
    9. Click New.
    10. Specify the following values, and then click Apply:
      Database type
      DB2
      Provider type
      DB2 Universal JDBC Driver Provider
      Implementation type
      XA data source
      Name
      maxJdbcProvider
    11. Click Next.
    12. Complete the WebSphere Application Server variable ${DB2UNIVERSAL_JDBC_DRIVER_PATH} field with a value of<WAS_HOME>ctgMX\lib For example, C:\Program Files\IBM\WebSphere\AppServer\ctgMX\lib.
    13. Click Next.
      Figure 1. Create a new JDBC providerCreate a new JDBC provider.
    14. Click Finish.
    15. Click Save.
  4. Open a command prompt and copy <DB2_HOME>/java/db2jcc.jar and <DB2_HOME>/java/db2jcc_license_cu.jar to the<WAS_HOME>\ctgMX\lib directory. Go back to Resources > JDBC > JDBC Providers > maxJdbcProvider, and correct the class path if required for both db2jcc.jar and db2jcc_license_cu.jar. Ensure that each jar file has the full path from ${DB2UNIVERSAL_JDBC_DRIVER_PATH}
  5. Configure WebSphere Application Server:
    1. From the WebSphere Application Server Network Deployment administrative console, browse to Resources > JDBC > Data sources.
    2. Under Scope, click Show scope selection drop-down list with the all scopes option, select Cell=ctgCell01, and then, underPreferences, click Apply.
    3. Click New.
    4. Specify the following values:
      Data source name
      intjmsds
      JNDI name
      jdbc/intjmsds
    5. From the Component-managed authentication alias and XA recovery authentication alias menu, select maxJaasAlias
    6. Click Next.
    7. Choose Select an existing JDBC provider, and then select maxJdbcProvider from the menu.
    8. Click Next.
    9. Specify the following values:
      Database name
      maxsibdb
      Driver type
      4
      Server name
      Specify the DB2 server host name.
      Port number
      Specify the DB2 port number. For example, 50005.
    10. Ensure the Use this data source in container managed persistence (CMP) option is selected, and then click Next.
    11. Click Finish.
    12. Click Save.
  6. Verify the data source by selecting intjmsds, and then clicking Test Connection.

No comments: