Configure a JDBC provider and data source

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.

Why and when to perform this task

Each vendor database requires different JDBC driver implementation classes for JDBC connectivity. Configure a JDBC provider to encapsulate those vendor-specific driver files for use by an application server. The application server also requires data sources to obtain and manage the physical connections between applications and databases. Configure at least one data source for association with each of your JDBC providers.

  1. Determine the version of data source that you need according to your code specification level.

    • The Enterprise JavaBean (EJB) 1.0 specification and the Java Servlet 2.2 specification require the Version 4.0 Data source.

    • More advanced releases of these specifications require the current version data source (which is designated in WebSphere Application Server simply as "Data source," with no associated version number).

  2. Determine the data source requirements for your application and database.

    Those requirements include JDBC provider types, JDBC driver files, and data source connection properties. Consult the article Vendor-specific data sources minimum required settings for detailed listings of this information per data source implementation.

  3. 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.

  4. 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.

  5. Bind the resource reference. See Binding to a data source

  6. Test the connection (for non-container-managed persistence usage). See Test connection .

Result If your data source fails, consult the article Cannot access a data source. If your data source fails while trying to connect to 64-bit DB2, see the technote at http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&dc=DB520&dc=D600&dc=DB530&dc=D700&dc=DB500&dc=DB540&dc=DB510&dc=DB550&q1=AMD&uid=swg21212809&loc=en_US&cs=utf-8&lang=en for information on fixing incomplete DB2 installation files.


Sub-topics
Vendor-specific data sources minimum required settings
Configuring a JDBC provider using the administrative console
Configuring a data source using the administrative console
Creating a data source for a clustered environment
Creating and configuring a JDBC provider and data source using the Java Management Extensions API
Verifying a connection
Test connection service

Related concepts
JDBC providers
Data sources
Looking up data sources with resource references for relational access
Binding to a data source

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 (Version 4)
JDBC Provider