The following examples demonstrate how to test the connection to a DataSource object in the WebSphere Application Server V4.0 and V6.x.
Use the following examples:
set myds /JDBCDriver:mydriver/DataSource:myds/ DataSource testConnection $myds
The testConnection command is part of the AdminControl object because it is an operational command. This particular type of operational command takes a configuration ID as an argument, so you invoke the getid command on the AdminConfig object:
set myds [$AdminConfig getid /JDBCProvider:mydriver/DataSource:mydatasrc/] $AdminControl testConnection $myds
myds = AdminConfig.getid('/JDBCProvider:mydriver/DataSource:mydatasrc/') AdminControl.testConnection(myds)