Configure a data source using the administrative console
Configuring a data source using the administrative console
Application components use a data source to access connection instances to a relational database. A connection pool is associated with each data source.
Application Server supports two different versions of data source. Determine the data source for your environment according to the enterprise bean and servlet specification levels that are the basis of your applications:
Version 4.0 data sources are for use with the 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.
Why and when to perform this task
When you set data source properties, you also associate the data source with a JDBC provider that is configured for access to a specific vendor database. WebSphere Application Server uses the entire JDBC provider and data source configuration to obtain physical connections to this database.
Open the administrative console.
Open the administrative console. Click Resources >
JDBC Providers .
Open the administrative console. Choose the JDBC resource provider under which you want to create your data source. The detail page for this provider is displayed.
Open the administrative console. 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.
Open the administrative console. Click New to display the Data source settings page.
Open the administrative console. Verify that all the required properties have valid values.
For data sources of the latest standard version:
Select a DataStoreHelper class name from the list entitled DataStoreHelpers provided by WebSphere Application Server, or leave the default selection as is. If you want to use a data store helper other than those available in the drop-down list, 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.
Open the administrative console. 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 first two choices.)
Click on the first link to define settings that affect the behavior of the Java 2 Connector (J2C) connection pool manager.
Go to the Custom properties page to view and modify additional properties that the database vendor might require for the connection of its product to an application server.
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.
Open the administrative console. Click Save.
Open the administrative console. Return to the data source page to confirm that your new data source is displayed in the list.