Configuring a JDBC provider and data source
For access to relational databases, applications use the Java™ Database Connectivity (JDBC) drivers and data sources that you configure for the application server.
Before you begin
- Data sources (WebSphere® Application Server Version 4) (deprecated) are for use with the Enterprise JavaBeans (EJB) 1.0 specification and the Java Servlet 2.2 specification.
Deprecated feature: depfeat
- Data sources of the latest standard version are for use with applications that implement the more advanced releases of these specifications.
![[z/OS]](../images/ngzos.gif)
Procedure
- Verify that all of the necessary JDBC driver files are installed on your node manager. Consult the article, Data source minimum required settings, by vendor for that information. If you opt to configure a user-defined JDBC provider, check your database documentation for information about the driver files.
- Create a JDBC provider.
When you create a JDBC provider from the administrative console, see the topic, Configuring a JDBC provider using the administrative console; or
Using the wsadmin scripting client, see the topic, Configuring a JDBC provider using the scripting; or
Using the Java Management Extensions (JMX) API, see the topic, Creating a JDBC provider and data source using the JavaManagement Extensions API.
- Create a data source.
From the administrative console, see the topic, Creating a data source using the administrative console; or
Using the wsadmin scripting client, see the topic, Configuring new data sources using scripting. For V4 data sources, see the topic, Configuring new WAS40 data sources using scripting (deprecated); or
Using the JMX API, see the topic, Creating a JDBC provider and data source using the JavaManagement Extensions API.
Required properties: Different database vendors require different properties for implementations of their JDBC drivers. Set these properties on the WebSphere Application Server data source. Because Application Server contains templates for many vendor JDBC implementations, the administrative console surfaces the required properties and prompts you for them as you create a data source. However, if you script your data access configurations, you must consult the article Data source minimum required settings, by vendor, for the required properties and settings options. - Optional: Configure custom properties.
Like the required properties, custom properties for specific vendor JDBC drivers must be set on the application server data source. Consult your database documentation for information about available custom properties. To configure a custom class to facilitate the handling of database properties that are not recognized natively by the Application Server, refer to the topic, Developing a custom DataStoreHelper class.
There are also optional data source properties, such as the DB2 sslConnection custom property, that you might want to configure. Refer to the Application Programming Guide and Reference for Java for your version of DB2 for z/OS if you use the DB2 Universal JDBC Driver provider for more information about these custom properties.
- Bind resource references to the data source. See the article, Data source lookups for enterprise beans and web modules.
- Test the connection (for non-container-managed persistence usage). See the topic, Test connection service.
Results
Even if you receive information about a bad credential, check the database and JDBC trace logs. These logs provide more reliable, detailed error data on authentication failures.

Subtopics
Data source minimum required settings, by vendor
These properties vary according to the database vendor requirements for Java Database Connectivity (JDBC) driver implementations. You must set the appropriate properties on every data source that you configure.Data source minimum required settings for Apache Derby
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Apache Derby data sources.Data source minimum required settings for DB2 with the application server on AIX, HP-UX, Linux, Solaris, or Windows
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for a DB2 data source that is connecting to an application server that is running on AIX®, HP-UX, Linux, Solaris, or Windows systems.Data source minimum required settings for DB2 on z/OS and an application server on z/OS
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for a DB2 data source that is running on z/OS and will be accessed by applications in an application server that is also running on z/OS.Data source minimum required settings for DB2 Universal Database for IBM i
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for a DB2 UDB data source.Data source minimum required settings for Informix
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Informix® data sources.Data source minimum required settings for Microsoft SQL Server
These properties vary according to the database vendor requirements for Java Database Connectivity (JDBC) driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Microsoft SQL Server data sources.Data source minimum required settings for Oracle
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Oracle data sources.Data source minimum required settings for Sybase
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Sybase data sources.Configuring a JDBC provider using the administrative console
To create connections between an application and a relational database, the application server uses the driver implementation classes that are encapsulated by the Java Database Connectivity (JDBC) provider.Configuring a JDBC provider for a clustered environment
Use these steps to define a data source on multiple nodes that comprise a cluster.Configuring a data source using the administrative console
Application components use a data source to access connection instances to a relational database.Setting up a connection to an HADR-enabled DB2 database
If you are using DB2 Version 8.2 or later as a datasource, you might want to take advantage of the high availability disaster recovery (HADR) functionality that is available in these versions of DB2. Even though you must Install two instances of DB2 on your machine before you can use the HADR functionality, you only need to configure the primary DB2 database as a data source. The HADR functionality that the primary DB2 database provides automatically handles the rerouting of data to the backup DB2 database.ResourceManagement command group for the AdminTask object
You can use the Jython or Jacl scripting languages to configure resource providers with the wsadmin tool. The commands and parameters in the ResourceManagement group can be used to define and display properties for resource providers.Creating and configuring a JDBC provider and data source using the JMX API
If your application requires access to a relational database using the Java Database Connectivity (JDBC) API, you can create the necessary JDBC provider and data source objects using the Java Management Extensions (JMX) API exclusively. Alternatively, you can use the JMX API in combination with the wsadmin scripting tool.Accessing an existing Java EE data source resource
The same DataSource MBean and JDBCProvider MBean programming model that you use to access a WebSphere Application Server managed data source (defined in scripting or the Integrated Solutions Console) can be used to access a Java™ Platform Enterprise Edition (Java EE) data source resource that is defined in the application with the DataSourceDefinition annotation or with the <data-source> element of the deployment descriptor. This feature maintains compatibility with existing scripts, simplifying the management of your resources.Using the DB2 Universal JDBC Driver to access DB2 for z/OS
The z/OS operating system requires that you configure the DB2 Universal JDBC Driver and your database to ensure interoperability. Within WebSphere Application Server, configure a Java Database Connectivity (JDBC) provider object and a data source object to implement the driver capabilities for your applications.Creating a data source that uses the Oracle JDBC Driver for OCI
You can use the Oracle JDBC for OCI driver with Version 7.0 and later of the Application Server.Configuring Oracle Real Application Cluster (RAC) with the application server
Oracle Real Application Cluster (RAC) is a "share-everything" database architecture in which two or more Oracle RAC nodes are clustered together and share the same storage. The RAC nodes are connected together with a high-speed interconnect that enables fast communication between the Oracle nodes. The nodes can exchange various categories of data block ownership information during startup, lock information, exchange transaction information and data, and so on.Configuring client reroute for applications that use DB2 databases
The client reroute feature enables you to configure your client applications for a DB2 universal database to recover from a communication loss, and the applications can continue to work with minimal interruption. Rerouting is central to the support of continuous operations, but rerouting is only possible when there is an alternate location that is identified to the client connection.Configuring client affinities for applications that use DB2 databases
The client affinities feature is an alternative to automatic client reroute when enabling your data source to use other servers when a connection fails. In this client-only method, the client determines the order that alternate servers run during failover. For more information about client affinities, see the topic, Client affinities for DB2 Database for Linux, UNIX, and Windows, in the DB2 information center.Verifying a data source connection
Many connection problems can be easily fixed by verifying configuration parameters. There are steps that you must complete to enable a successful connection.Test connection service
WebSphere Application Server provides a test connection service for validating data source configurations. The testConnection operation instantiates the data source configuration, gets a connection, and then immediately closes the connection.Testing a connection with the administrative console
After you have defined and saved a data source, you can click the Test Connection button to ensure that the parameters in the data source definition are correct.Testing a connection using wsadmin
The AdminControl object of the wsadmin scripting tool has a testConnection operation that tests the configuration properties of a data source object.Configuring data source JDBC providers to use pureQuery in a Java SE environment
Use this task to configure the application data source Java Database Connectivity (JDBC) provider to use pureQuery to access DB2 in a Java Standard Edition (Java SE) environment. This configuration is for use with the Java™ Persistence API (JPA) 2.0 specification provider, WSJPA.Configuring data source JDBC providers to use pureQuery in a Java SE environment
Use this task to configure the application data source Java Database Connectivity (JDBC) provider to use pureQuery to access DB2 in a Java Standard Edition (Java SE) environment. This configuration is for use with the Java™ Persistence API (JPA) 2.0 specification provider, WSJPA.Data source minimum required settings, by vendor
These properties vary according to the database vendor requirements for Java Database Connectivity (JDBC) driver implementations. You must set the appropriate properties on every data source that you configure.Data source minimum required settings for Apache Derby
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Apache Derby data sources.Data source minimum required settings for DB2 with the application server on AIX, HP-UX, Linux, Solaris, or Windows
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for a DB2 data source that is connecting to an application server that is running on AIX, HP-UX, Linux, Solaris, or Windows systems.Data source minimum required settings for DB2 on z/OS and an application server on z/OS
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for a DB2 data source that is running on z/OS and will be accessed by applications in an application server that is also running on z/OS.Data source minimum required settings for DB2 Universal Database for IBM i
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for a DB2 UDB data source.Data source minimum required settings for Informix
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Informix data sources.Data source minimum required settings for Microsoft SQL Server
These properties vary according to the database vendor requirements for Java Database Connectivity (JDBC) driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Microsoft SQL Server data sources.Data source minimum required settings for Oracle
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Oracle data sources.Data source minimum required settings for Sybase
These properties vary according to the database vendor requirements for JDBC driver implementations. You must set the appropriate properties on every data source that you configure. These settings are for Sybase data sources.Configuring a JDBC provider using the administrative console
To create connections between an application and a relational database, the application server uses the driver implementation classes that are encapsulated by the Java Database Connectivity (JDBC) provider.Configuring a JDBC provider for a clustered environment
Use these steps to define a data source on multiple nodes that comprise a cluster.Configuring a data source using the administrative console
Application components use a data source to access connection instances to a relational database.Setting up a connection to an HADR-enabled DB2 database
If you are using DB2 Version 8.2 or later as a datasource, you might want to take advantage of the high availability disaster recovery (HADR) functionality that is available in these versions of DB2. Even though you must Install two instances of DB2 on your machine before you can use the HADR functionality, you only need to configure the primary DB2 database as a data source. The HADR functionality that the primary DB2 database provides automatically handles the rerouting of data to the backup DB2 database.ResourceManagement command group for the AdminTask object
You can use the Jython or Jacl scripting languages to configure resource providers with the wsadmin tool. The commands and parameters in the ResourceManagement group can be used to define and display properties for resource providers.Creating and configuring a JDBC provider and data source using the JMX API
If your application requires access to a relational database using the Java Database Connectivity (JDBC) API, you can create the necessary JDBC provider and data source objects using the Java Management Extensions (JMX) API exclusively. Alternatively, you can use the JMX API in combination with the wsadmin scripting tool.Accessing an existing Java EE data source resource
The same DataSource MBean and JDBCProvider MBean programming model that you use to access a WebSphere Application Server managed data source (defined in scripting or the Integrated Solutions Console) can be used to access a Java™ Platform Enterprise Edition (Java EE) data source resource that is defined in the application with the DataSourceDefinition annotation or with the <data-source> element of the deployment descriptor. This feature maintains compatibility with existing scripts, simplifying the management of your resources.Using the DB2 Universal JDBC Driver to access DB2 for z/OS
The z/OS operating system requires that you configure the DB2 Universal JDBC Driver and your database to ensure interoperability. Within WebSphere Application Server, configure a Java Database Connectivity (JDBC) provider object and a data source object to implement the driver capabilities for your applications.Creating a data source that uses the Oracle JDBC Driver for OCI
You can use the Oracle JDBC for OCI driver with Version 7.0 and later of the Application Server.Configuring Oracle Real Application Cluster (RAC) with the application server
Oracle Real Application Cluster (RAC) is a "share-everything" database architecture in which two or more Oracle RAC nodes are clustered together and share the same storage. The RAC nodes are connected together with a high-speed interconnect that enables fast communication between the Oracle nodes. The nodes can exchange various categories of data block ownership information during startup, lock information, exchange transaction information and data, and so on.Configuring client reroute for applications that use DB2 databases
The client reroute feature enables you to configure your client applications for a DB2 universal database to recover from a communication loss, and the applications can continue to work with minimal interruption. Rerouting is central to the support of continuous operations, but rerouting is only possible when there is an alternate location that is identified to the client connection.Configuring client affinities for applications that use DB2 databases
The client affinities feature is an alternative to automatic client reroute when enabling your data source to use other servers when a connection fails. In this client-only method, the client determines the order that alternate servers run during failover. For more information about client affinities, see the topic, Client affinities for DB2 Database for Linux, UNIX, and Windows, in the DB2 information center.Verifying a data source connection
Many connection problems can be easily fixed by verifying configuration parameters. There are steps that you must complete to enable a successful connection.Test connection service
WebSphere Application Server provides a test connection service for validating data source configurations. The testConnection operation instantiates the data source configuration, gets a connection, and then immediately closes the connection.Testing a connection with the administrative console
After you have defined and saved a data source, you can click the Test Connection button to ensure that the parameters in the data source definition are correct.Testing a connection using wsadmin
The AdminControl object of the wsadmin scripting tool has a testConnection operation that tests the configuration properties of a data source object.


File name: tdat_tccrtprovds.html