Chapter 9. Accessing relational databases from WebSphere 357
6. Click OK.
9.4 Connecting to an IBM DB2 database
In this section, we illustrate how to configure a JDBC provider using a DB2 provider as an
example.
9.4.1 Creating the JDBC provider
To create a JDBC provider, complete the following steps from the administrative console:
1. Ensure that the implementation classes for the provider are available to the system. The
class files will need to be located on each system where the application servers will run.
2. In the administrative console, expand Resources JDBC in the navigation tree.
3. Click JDBC Providers.
4. Select the scope. (Although you can click All scopes to view all resources, you must
select a specific scope to create a resource.)
The administrative console now shows all of the JDBC providers that are created at that
scope level.
5. Click New to start the wizard and to create a new JDBC provider.
Note: JDBC resources are created at a specific scope level. The data source scope
level is inherited from the JDBC provider. For example, if we create a JDBC provider at
the node level and then create a data source using that JDBC provider, the data source
inherits:
The JDBC provider settings, such as class path, implementation class, and so on
The JDBC provider scope level
In this example, if the scope were set to node-level, all application servers running on
that node register the data source in their name space.
358 WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile
6. In Step 1 of the wizard, define the type of provider you will use. See Figure 9-4.
Figure 9-4 Define a new JDBC provider: Window 1
Specify the following information:
Database type
Select the vendor-specific database type. If the database type you need is not in the
list, click User-defined, and consult the vendor documentation for the specific
properties that are required.
–Provider type
Select from a predefined list of supported provider types, based on the database type
that you select.
Implementation type
Select from the implementation types for the provider type that you selected.
–Name
Specify a name for this driver.
Click Next.
7. The settings window for your JDBC database class path opens. Figure 9-5 on page 359
shows the configuration window for the DB2 Universal JDBC Provider.
Chapter 9. Accessing relational databases from WebSphere 359
Figure 9-5 Define a new JDBC provider - Window 2
Enter the JDBC provider properties:
Class path
This field is a list of paths or JAR file names that together form the location for the
resource provider classes. This field is pre-set using variable names that are specific to
each type of provider. If you are creating a user-defined provider, specify the entries by
pressing Enter between each entry.
The remaining properties are dependent on the type of provider. They represent the
variables that are used in the class path and their value. If you enter a value for a variable
on this window, the corresponding variables are populated automatically with these
values. Conversely, if the variables are already defined, these fields are populated with the
variables.
You can view or modify the variables by clicking Environment WebSphere Variables
in the navigation menu.
Because this example is for DB2, the following fields are available:
Path to db2jcc.jar, db2jcc_license_cisuz.jar
This field specifies the values for the global variable
DB2UNIVERSAL_JDBC_DRIVER_PATH, which indicates the class path jar’s location.
Native Library Path
This field is an optional path to any native libraries. Entries are required if the JBDC
provider chosen uses non-Java, or native, libraries. The global variable for this is
UNIVERSAL_JDBC_DRIVER_NATIVEPATH.
Click Next.
8. After verifying the settings, click Finish.

Get WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.