Application components use a data source to access connection instances
to a relational database.
Before you begin
The application server supports two different versions of a data
source. Determine the data source for your environment according to the enterprise
bean and the servlet specification levels that are the basis of your applications:
- Data sources (Version 4) are for use with the Enterprise
JavaBeans (EJB) 1.0 specification and the Java Servlet 2.2 specification.
- Data sources of the latest standard version are for use with applications
that implement the more advanced releases of these specifications.
About this task
When you create a data source, you must associate it with a JDBC
provider that is configured for access to a specific vendor database. The
application server requires that both objects for your application to make
calls to that particular database and receive data from it. The data source
provides the connection management capabilities that allow data exchanges
between your applications and the database server.
Procedure
- Open the administrative console.
- Click Resources > JDBC Providers.
- Choose the JDBC resource provider under which
you want to create your data source. The detail page for
this provider is displayed.
- Under Additional Properties, click the Data
Sources link that is appropriate for your application. The
Data sources or Data sources (Version 4) page is displayed.
- Click New to display the Data source
settings page.
- Verify that all the required properties have
valid values.
The following steps guide you through supplying
the property values, a process that is basically the same for both data source
types:
- Select a DataStoreHelper class name.
- You can choose a DataStoreHelper class name from the list that is provided. The
application server provides a class called DataStoreHelpers, or you can keep
the default selection.
- To use a data store helper other than what is provided, click Specify
a user-defined DataStoreHelper. Type a fully qualified class name
in the field that is provided.
- The next section of properties varies according to the database
selection, provider type, and implementation that you chose for your JDBC
provider. These properties are either required or highly recommended for your
data source. Provide valid values for these settings if you do not want to
accept the default values.
- Click Component-managed Authentication Alias if your
database requires a user ID and password for a connection. This
alias is used only when the application resource reference is using res-auth
= Application.
Important:(For components with res-auth=Container)
Both the Container-managed Authentication Alias and Mapping-Configuration
Alias settings are deprecated. They are superseded by the specification of
a login configuration on the resource-reference mapping at deployment time.
You must now use this login setting to define the aliases at deployment.
- If you chose XA Data Source as the implementation type of your
JDBC provider, you need to specify the alias used during transaction recovery
processing. An additional section entitled Authentication Alias for XA Recovery
is available. Select either Use Application Authentication Alias to
use the same value that you chose for component-managed authentication, or
select Specify: to choose a different alias from the drop-down list.
- Click Apply to view a page with your
new data source settings. Additional properties and Related items
sections are now available on this page. Additional properties contains the
Connection pool, Custom properties, and WebSphere Application Server data
source properties choices. (If you are using a Version 4 data source, however,
you see only the Connection pool and Custom properties links.)
- Click on the first link to define settings that affect the behavior
of the Java 2 Connector (J2C) connection
pool manager.
- Use the WebSphere Application
Server data source properties page to input settings that exclusively
affect the application server's connection to the database.
- Go to the Custom properties page
to view and modify additional properties that the database vendor might require
or recommend for the connection of its product to an application server.
You can learn about these vendor-specific data source
properties in the
Application Programming Guide and Reference for Java for
your version of DB2 for z/OS, if you use one of the following JDBC providers:
- DB2 for zOS Local JDBC Provider (RRS) JDBC Provider (using the DB2 JDBC
/ SQLJ driver)
- DB2 Universal JDBC Driver provider
- The Related items section (applicable only to later version
data sources, not Version 4 data sources) contains the J2C
Authentication data entries choice. Here, you can specify a list of
user IDs and passwords for J2C security to use.
- Click Save.
- Return to the data source page to confirm
that your new data source is displayed in the list.
What to do next
You can override the default values for some data source properties.
You can also configure additional properties that your database vendor might
require or offers as options. Consult your database documentation about these
settings.
If you use the DB2 Universal JDBC Driver provider,
learn about optional data source properties in the Application Programming
Guide and Reference for Java for your version of DB2 for z/OS.
The
following topics in this information center inform you how to use the administrative
console to assign or modify property values: