Message Image  

WebSphere Application Server & Liberty

Installing a Data Source on Websphere Application Server - From DB2 to MySQL 

21 days ago

Author: Christopher Kramer

Overview

Skill Level: Beginner

This recipe is designed to detail adding a data source to Websphere Application Server. This is useful for products like BPM that require data sources to be added through WAS.

Ingredients

  • Driver for datasource saved as jar file
  • WAS login credentials
  • Database target information (url, port, etc.)

Step-by-step

  1. Login to Websphere

    Url is typically: <Server>:9060/ibm/console   or   <Server>:9043/ibm/console

    Login using admin credentials

  2. Navigate to Data Sources

  3. Create New Datasource

  4. Enter basic data source information and proceed to selecting JDBC provider.

    • Preface JNDI name with “jdbc/” followed by your database name
    • It is assumed that you do not already have a JDBC provider available. If you have one that supports your datasource, just use that and proceed to step 6. Otherwise, select create new JDBC provider and hit next

  5. Create JDBC provider

    • Select your Database type from the dropdown. There are a number of databases like DB2 which are supported by WAS out of the box. An example is shown below.

    • If your database is not readily supported, select User-Defined from the database types.

    • Depending on your database type you will need to enter the following information for Implementation class name
      • PostgreSQL: org.postgresql.jdbc2.optional.ConnectionPool
      • MySQL: com.mysql.jdbc.jdbc2.optionalMysqlConnectionPoolDataSource
      • etc. (will need to reference database documentation)
    • Finally, click Next, enter the directory location of the JAR file for your datasource driver, and click next to proceed.
  6. Specify the Location of your Database

    • This information should be the usual information needed to access your database

  7. Add security credentials

    • Once you are presented with the following screen it will ask you to select a J2C security credential. You will need to create one if one does not already exist. I recommend opening the link in a new tab to preserve your old session while you create the credentials in the new tab. 

    • Once your credentials are successfully added select them as the authentication alias and select default mapping if necessary.
  8. Finalize and Test your Datasource

    • Once your datasource is complete return to the datasource screen, select your new datasource, and click test.
    • There may be a few minor things that need to be tweaked for specific datasources but once the test succeeds your datasource should be available.
  9. Additional Notes

    • For PostgreSQL and others, you may need to indicate certain database properties:     
      • click on your datasource     
      • select custom properties on the right hand side of the screen     
      • find the properties you need to set and do so.     
      • Save to master configuration when done
    • For MySQL you may need to add configuration option for url:     
      • jdbc:mysql://localhost/SERVERNAME?useUnicode=true&characterEncoding=UTF-8

#WebSphereApplicationServer

Statistics

0 Favorited
14 Views
0 Files
0 Shares
0 Downloads