WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Configuring a JDBC provider and data source

For access to relational databases, applications use the JDBC drivers and data sources that you configure for the application server.

Before you begin

Each vendor database requires different JDBC driver implementation classes for JDBC connectivity. A JDBC provider encapsulates those vendor-specific driver files. Through the data source that you associate with the JDBC provider, an application server obtains and manages the physical connections for transactions between applications and the database.
Determine the version of data source that you need according to the API specification of your applications.
  • Version 4 Data sources 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.

Procedure

  1. 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.
  2. Create a JDBC provider.

    From the administrative console, see Creating a JDBC provider using the administrative console.

    OR

    Using the wsadmin scripting client, see Configuring a JDBC provider using scripting .

    OR

    Using the Java Management Extensions (JMX) API, see Creating a JDBC provider and data source using the Java Management Extensions API.

  3. Create a data source.

    From the administrative console, see Creating a data source using the administrative console.

    OR

    Using the wsadmin scripting client, see Configuring new data sources using scripting . (For V4 data sources, see Configuring new WAS40 data sources using scripting .)

    OR

    Using the JMX API, see Creating a JDBC provider and data source using the Java Management 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.
  4. 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.
  5. Bind resource references to the data source. See the article Data source lookups for enterprise beans and Web modules .
  6. Test the connection (for non-container-managed persistence usage). See the Test connection service article.

Results

If you use the DB2 JDBC Universal Driver, you might experience data source failures that the application server JVM log does not document. Check the DB2 database log or the WebSphere Application Server JDBC trace log (if JDBC trace was active). You might find that a bad authentication credential is the cause of failure. Currently the DB2 JDBC Universal Driver does not identify or surface the errors that are produced by non-valid authentication credentials in a proper or consistent way.

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.

Tip: The JDBC trace log exists only if the JDBC trace service is active during server start up. Activate the service in the administrative console. For more information, see Enabling trace at server startup . Specify WAS.database as the trace group and select com.ibm.ws.db2.logwriter as the trace string.



Sub-topics
Data source minimum required settings, by vendor
Configuring a JDBC provider using the administrative console
Configuring a JDBC provider for a clustered environment
Configuring a data source using the administrative console
Creating and configuring a JDBC provider and data source using the Java Management Extensions API
Verifying a connection
Test connection service
Testing a connection with the administrative console
Testing a connection using wsadmin
Related concepts
JDBC providers
Data sources
The benefits of using resource references
Data source lookups for enterprise beans and Web modules
Related tasks
Configuring a JDBC provider using scripting
Configuring new data sources using scripting
Configuring new WAS40 data sources using scripting
Related reference
Data source collection
Data sources (WebSphere Application Server V4)
JDBC provider collection
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tdat_tccrtprovds.html

© Copyright IBM Corporation 2002, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)