WAS v8.5 > Administer applications and their environment > Welcome to administering Data access resources > Administer data access applications > Configure a JDBC provider and data source

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.

The testConnection operation takes a data source configuration ID as an argument.

This invocation cannot accept user IDs and passwords that must be defined in the database itself. This invocation can be used only for databases that do not require a user ID and password to make a connection (such as DB2 on a Windows machine), or for data sources that have a component-managed or container-managed authentication alias set on the data source object.

  1. Start the getid() method for the data source.

  2. Set the value of the configuration ID to a variable.

      set myds [$AdminConfig getid /JDBCProvider:mydriver/DataSource:mydatasrc/]
    where JDBCProvider:mydriver/DataSource:mydatasrc is the data source to test. After we have the configuration ID of the data source, we can test the connection to the database.
  3. Test the connection to the database. Use the following command:

      $AdminControl testConnection $myds


Related concepts:

Test connection service


Related


Testing a connection with the dmgr console


+

Search Tips   |   Advanced Search