Set a data source using the admin console
Application components use a data source to access connection instances to a relational database. Data sources are associated with JDBC providers, which provide access to specific vendor databases.
To configure, from the admin console...
- Go to...
Resources | JDBC | Data sources
...or...
Resources | JDBC | Data sources (WAS V4)...or...
Resources | JDBC | JDBC providers | jdbc_provider | Data sources...or...
Resources | JDBC | JDBC providers | jdbc_provider | Data sources (WAS V4)- For scope choose cell, node, cluster, or server.
- Click New to launch the Create a data source wizard to launch.
The first field is the scope field, which is read-only and displays the previous scope selection.
- Type a data source name in the Data source name field.
This name identifies the data source for admin purposes only.
- Fill in the JNDI name field.
Do not assign duplicate JNDI names across different resource types, such as data sources versus J2C connection factories or JMS connection factories.
Do not assign duplicate JNDI names for multiple resources of the same type in the same scope.
- Click Next to see the Select JDBC provider panel.
The Select JDBC provider panel is skipped if we do not have any JDBC providers that are configured at the current scope.
- Select an existing JDBC provider, or create a new provider.
- Select an existing JDBC provider.
- Click Select an existing JDBC provider.
- Select a JDBC driver from the drop-down list.
- Click Next. You now see the panel entitled Enter database specific properties for the data source.
- Create a new JDBC provider.
- Click Create new JDBC provider.
- Click Next to see the Create JDBC provider panel.
- Use the first drop-down list to select the database type of the JDBC provider that we need to create. The User-Defined option: Select User-Defined for your database type if we encounter either of the following scenarios:
- You do not see the database type.
- We cannot select the JDBC provider type that we need in the next step.
The user-defined selection triggers the wizard panel to display the provider type as a User-defined JDBC provider, and the implementation type as User-defined. Consult the database documentation for the JDBC driver class files, data source properties, and so on that are required for the user-defined provider. Supply this information on the next two wizard panels:
- database class path information
- database-specific properties
- If the JDBC provider type is displayed in the second drop-down list, select your JDBC provider type.
Select Show Deprecated to trigger the display of both current and deprecated providers. If we cannot find the provider in this expanded list, then select User-Defined from the previous list of database types.
- From the third drop-down list, select the implementation type that is necessary for the application.
If the application does not require that connections support two-phase commit transactions, choose Connection Pool Data Source.
Choose XA Data Source, however, if the 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 the JDBC provider. We can type different values for these fields; they exist for administrative purposes only.
- Click Next after we have defined the database type, provider type, and implementation type.
Now you see the wizard panel Enter database class path information.
- In the class path field, type the full path location of the database JDBC driver class files.
The class path information becomes the value of the WebSphere environment variable that is displayed on this panel, in the form of...
${DATABASE_JDBC_DRIVER_PATH}The appserver uses the variable to define the JDBC provider; this practice eliminates the need to specify static JDBC class paths for individual applications.
If we do not provide the full, correct JDBC driver class path for the variable, the data source ultimately fails. If the field already displays a fully qualified class path, we can accept that variable definition by completing the rest of this wizard panel and clicking Next.
- Use the Native library path field to specify additional class files that the JDBC driver might require to function properly. Type the full directory path name of these class files.
- Click Next.
- Complete all of the fields on the Enter database specific properties for the data source panel.
If required, click Use this data source in container managed persistence (CMP)
Any other property fields that are displayed on this wizard panel are specific to the database type
This wizard panel does not display additional property fields for data sources corresponding to user-defined JDBC providers. However, from the JDBC driver class files that you installed, WAS can generally...
- extract data source property names
- define them as data source custom properties
- display them on a custom properties console panel
- assign them default values
After you create the data source, navigate to the corresponding custom properties collection panel in the admin console by clicking...
Data sources | data_source | Custom properties
Review the property default values and modify them if necessary.
The appserver can only extract vendor-specific properties from the driver class files if we install the files on the dmgr node and configure their representative WebSphere variables correctly. Otherwise, WAS ND displays an informational message (as opposed to an error message) that directs you to manually define the necessary properties as custom properties.
- Set the security aliases for the data source.
We can select none for any of the authentication methods, or choose one of the following types:
- Component-managed authentication alias
Authentication alias to use when the component resource reference res-auth value is Application.
To define a new alias...
Related Items | J2EE Connector Architecture (J2C) authentication data entries
A component-managed alias represents a combination of ID and password specified in an application for data source authentication. Therefore, the alias set on the data source must be identical to the alias in the application code.
- Use the drop-down list to select an existing component-managed authentication alias.
- To create a new alias, click the links that are provided.
This action closes the data source wizard and triggers the admin console to display the J2C authentication data panel.
Click New to define a new alias.
Click OK to save the settings and view the new alias on the J2C authentication data panel.
Restart the data source wizard by navigating back to the data source collection panel, selecting the appropriate scope, and clicking New.
- Mapping-configuration alias
Used only in the absence of a login configuration on the component resource reference.
The spec of a login configuration and the associated properties on the component resource reference is the preferred way to define the authentication strategy when the res-auth value is set to Container. If specify the DefaultPrincipalMapping login configuration, the associated property will be a JAAS - J2C authentication data entry alias.
- Container-managed authentication alias
Used only in the absence of a login configuration on the component resource reference. The spec of a login configuration and the associated properties on the component resource reference determines the container-managed authentication strategy when the res-auth value is set to Container.
New feature: If we have defined security domains in the appserver, we can click Browse... to select an authentication alias for the resource that we are configuring. Security domains allow us to isolate authentication aliases between servers. The tree view is useful in determining the security domain to which an alias belongs, and the tree view can help you determine the servers that will be able to access each authentication alias. The tree view is tailored for each resource, so domains and aliases are hidden when we cannot use them
- Click Next to view the Summary panel, and review any information for the data source.
If any information is not correct, we can click Previous to go back and correct it.
- Click Finish to save the configuration and exit the wizard. You now see the Data sources panel, which displays the new configuration in a table along with other data sources that are configured for the same scope.
What to do next
We can override the default values for some data source properties.
 
Related concepts
Connection pool settings
Tuning connection pools
WAS data source properties
Java EE resource provider or connection factory custom properties collection
Disable statement pooling
Data source collection
Data source (WAS V4) collection
Custom Properties (Version 4) collection
Data source lookups for enterprise beans and Web modules
Data sources
JDBC providers
Naming
Related tasks
Manage J2C Architecture authentication data entries
Related
Example: Use JMX to create a JDBC driver and data source for BMP beans, session beans, or servlets
Example: Use JMX to create a JDBC driver and data source for a CMP bean
Data source minimum required settings, by vendor
Data source settings
Data source (WAS V4) settings