How to Create a WebSphere Application Server JDBC Provider, J2C Authentication Alias, and Data Source for the IBM i

Technote (troubleshooting)


Problem(Abstract)

This document will discuss how to create a WebSphere Application Server JDBC provider, J2C Authentication Alias, and Data source for the IBM i.

Resolving the problem

Note: This document will cover only the IBM Toolbox for Java and Native JDBC providers available for the IBM i. There are several other JDBC providers that can be configured within WebSphere Application Server (WAS); however, those providers will not be discussed in this document.

This document will discuss how to create a WebSphere Application Server JDBC provider, J2C Authentication Alias, and Data source for the IBM i.
    • - WAS Integrated Solution Console (ISC)



      1. Open a session to the WAS Integrated Solution Console (ISC).

      This can be done using the IBM Web Administration console for i or by accessing the ISC URL directly.

      a. IBM Web Administration console for i
      i. Access the http://<serverName>:2001/HTTPAdmin URL.
      ii. Click Manage -> Application Servers.
      iii. Select your WAS profile from the combo box.
      iv. Click the Launch Administrative Console link under Tools in the left-hand, vertical menu.

      b. Access the ISC URL directly
      i. Sign into a 5250 green screen.
      ii. Use WRKACTJOB to locate your WAS job.
      iii. Type 5 in the Opt column and press Enter to Work with the Job.
      iv. Type 10 on the command line and press Enter to Display job log.
      v. Press F10 and locate the WebSphere application server <serverName> ready message.
      vi. Place your cursor on the message and press F1.
      vii. Record the port number listed.
      viii. Use the port number in the following URL to access the ISC:
      http://<serverName>:<port>/ibm/console (for example, http://a400:20001/ibm/console)
      Note: If administrative security is enabled, it will automatically redirect you to the HTTPS URL and port.

      2. After you log in to the ISC, you should see a similar screen:

      Screen shot of Welcome screen in the WebSphere Integrated Solutions Console (ISC).

      • - Create a new JDBC provider



        3. Expand the Resources section. Underneath Resources, expand JDBC to view its resources.

        4. Click JDBC providers to display and manage the JDBC providers created for the cell, node, and server. (If you already have a provider created and would like to create just a J2C authentication alias and/or data source, skip to Step 10 or Step 14). Note: You might see previously created providers just as you see in the example below.

        Screen shot of the JDBC providers screen showing a list of the current JDBC providers.

        5. Select the scope at which applications can use the JDBC provider. You can choose a cell, node, cluster, or server. A drop down box is located under the section Scope towards the top of the main body of the page:

        Screen shot of the Scope section in the JDBC providers screen.

        6. Click New to create a new JDBC provider. This action causes the Create a JDBC provider wizard to launch and display the Enter basic JDBC provider information panel:

        Screen shot instructing the user to click on the

        7. Fill out the form to create a new JDBC provider. The first field is the scope field, which is read only. This field displays your previous scope selection.

        a. Select DB2 as the Database type.

        b. For the Provider type, the two most well-known providers for the IBM i are the DB2 UDB for iSeries (Native) or DB2 UDB for iSeries (Toolbox) values. Other providers are supported; however, they will not be covered in this document.

        c. Select Connection pool data source or XA data source for your Implementation type.  If your application does not require connections that support two-phase commit transactions, choose Connection Pool Data Source. Choose XA Data Source, however, if your application requires connections that support two-phase commit transactions. Applications that use this data source configuration have the benefit of container-managed transaction recovery. After you select an implementation type, the wizard fills the name and the description fields for your JDBC provider. You can type different values for these fields; they exist for administrative purposes only.

        d. Type a data source name in the Data source name field. This name identifies the data source for administrative purposes only.

        e. Click Next to proceed with the creation of the provider.

        Screen shot of the

        8. Enter the path to the JDBC provider Jar file. You can either specify the default path or your own custom path to the JDBC provider.

        The default paths for the two IBM i providers are as follows:

        IBM Toolbox:
        /QIBM/ProdData/HTTP/Public/jt400/lib

        WAS v7.0 and later:
        IBM Native: /QIBM/Proddata/java400/jdk6/lib/ext

        WAS v6.1 and earlier
        IBM Native: /QIBM/ProdData/Java400/ext

        IBM Toolbox Example

        Screen shot of the

        IBM Native Example at WAS v7.0

        Screen shot of the

        9. Review the summary of the options and values specified for the creation of the JDBC provider. Click Finish and then click Save to complete the provider creation.

        • - Create a new J2C authentication alias



          Note: This authentication alias is used to provide credentials for authentication to the IBM i Server. An authentication alias is required to be specified on a data source in order to successfully test the data source connectivity to the database. After the connectivity has been verified, the authentication alias configuration can be removed from the data source configuration if you plan to supply the authentication credentials through a different method.

          10. Expand Security and click the Global security link to display the global security configuration for the application server:

          Screen shot of the left-hand vertical menu with the Security section expanded instructing the client to click on Global security.

          11. Under the Authentication section. expand the Java Authentication and Authorization Server section and click J2C authentication data:

          Screen shot of the Authentication section in Global security with the Java Authentication and Authorizaton Service section expanded instructing the client to click on J2C authentication data.

          12. Click New to create a new authentication alias:

          Screen shot instructing the client to click on the

          13. Enter an alias name, an IBM i user ID you would like to use on the DB connection, and the user ID's password. The description field is optional. Then, click OK to save the configuration:

          Screen shot of the J2C authentication alias configuration screen when creating a new alias.

          • - Create a new WebSphere Data source



            14. Expand Resources -> JDBC in the left-hand vertical menu.

            Screen shot of the left-hand vertical menu with Resources -> JDBC expanded instructing the client to click on the Data source link.

            15. Click the Data sources link to display and manage your WebSphere Data sources created for the cell, node, and server.
            Note: You might see previously created providers just as you see in the example below:

            Screen shot of the Data sources screen listing the current data sources.

            16. Select the scope at which applications can use the data source. You can choose a cell, node, cluster, or server. A drop down box is located under the section Scope towards the top of the main body of the page:

            Screen shot of the Scope section on the Data sources page.

            17. Click New to create a new data source. This action causes the Create a data source wizard to launch and display the Enter basic data source information panel:

            Screen shot instructing the client to click on the

            18. Enter a data source name and a unique JNDI name. Typically, the JNDI name starts with the value jdbc/. For example, jdbc/Toolbox:

            Screen shot of the

            19. Click Next to continue.
            20. Click the radio button next to Select an existing JDBC provider, and select one of the available JDBC providers:

            Screen shot of the

            21. Click Next to continue.
            22. Enter the host name of the remote system containing the IBM i DB2 UDB you wish to connect to.
            Note: If you selected the DB2 UDB for iSeries (Native) JDBC provider in Step 16, you will want to type *LOCAL for the Server name field:

            Screen shot of the

            23. Click Next to continue.
            24. Select an authentication alias for the Component-managed and Container-managed drop down boxes. You can use the one recently created or another one of your choice. Then, click Next to continue:

            Screen shot of the

            25. Review the summary information on the data source configuration. Click Finish and then click Save to complete the data source creation.

            • - Test the WebSphere Data source connectivity to the database



              26. After the data source has been created successfully, it will bring you back to the main Data sources screen. Check the box next to the data source and click Test connection to test the data source connectivity to the database:

              Screen shot instucting the user to select the new data source and click on the

              27. You will receive a message similar to the following if the test connection to the database is successful:

              Screen shot of the connection successful message



            Congratulations! You have successfully created a new JDBC provider, J2C authentication alias, and/or a WebSphere Data Source within WebSphere Application Server.

            Historical Number

            613558175

            Rate this page:

            (0 users)Average rating

            Add comments

            Document information


            More support for:

            IBM i
            WebSphere Application Server

            Software version:

            5.4.0, 5.4.5, 6.1, 6.1.0, 7.1, 7.1.0

            Operating system(s):

            IBM i

            Reference #:

            N1011315

            Modified date:

            2013-02-10

            Translate my page

            Machine Translation

            Content navigation