Verify a connection

 

Overview

Many test connection problems can be easily fixed by verifying some configuration parameters This article provides a checklist of steps that you must complete to enable a successful connection. Click on the link for more information on a specific step.

If your connection is still not successful after completing these steps and reviewing the applicable information, check the SystemOut.log for warning or exception messages. Then use the technical support search function to find known problems.

  1. Create the authentication data alias.

  2. Create the JDBC provider.

  3. Create a V5.0 or 4.0 data source.

  4. Save the data source.

  5. Restart the server.

    If you are running Websphere Application Server V5.0.2, you do not have to complete this step unless you also created a new Java Authentication and Authorization Service (JAAS) entry.

  6. Test the connection

    You can test your connection from the data source collection view or the data source details view. Access either view in the administrative console, and then select a connection from the list. Click the test connection button on the connection.

    You must complete all the steps and restart the server before you test the connection. Neither the authentication data alias nor the WebSphere Application Server environment variables (in V5.0.1) are available before a server restart.

    In the Network Deployment environment, your test connection results depend on the Java Virtual Machine (JVM) that was running when you created the data source. If you defined the data source at the cell level, the test connection occurs on the deployment manager (dmgr). If you defined the data source at the node or server level, the test connection occurs on the node agent. You must restart the dmgr or the node agent on which the data source was defined, to acquire new or updated JAAS authentication alias entries and environment variables.

    Note: You must also restart the node agent if you have added an alias to your configuration and want to apply it to a data source for testing. Otherwise, the test connection service operation fails in the node agent.

    In a default WebSphere Application Server installation, the database driver path environment variables as, for example, DB2_JDBC_DRIVER_PATH, are defined and initialized to NULL at the node level. If you create a cell level data source and add the environment variable note indicating the node level environment variable will override the cell level value, your test connection will validate the datasource; however, your application programs will not work because the path to the database driver files is NULL. Ensure your default WebSphere Application Server database driver path environment variables are deleted or set to suitable values.

    The following table illustrates the combinations of data sources and related environment variables that can be tested:
    Testing connections on different data source and environment variable combinations

    Data sources Cell level variables Node level variables Server level variables
    Cell level Ok Fail Fail
    Node level Ok Ok Fail
    Server level Ok Ok Ok


    You can bypass this environment variable lookup by hard coding a path to the database driver. Defining a path does not mean the data source cannot be used in failure scenarios.


Related concepts
Test connection
JDBC providers
Data sources
Looking up data sources with resource references for relational access
Binding to a data source
Related tasks
Creating and configuring a JDBC provider using the administrative console
Creating and configuring a data source using the administrative console
Creating a JDBC provider on multiple nodes
Creating and configuring a JDBC provider and data source using the Java Management Extensions API
Related reference
Data Source collection
Data Sources (V4)
JDBC Provider collection