[Fix Pack 5.0.1 and later]Example: Testing data source connection using wsadmin to call a method on the MBean

The following example tests a dataSource, to ensure a connection to the database.

[Fix Pack 5.0.1 and later]Note: While this method still works for Version 5.0.1, it might not work in future releases of the product.

[Fix Pack 5.0.1 and later]The Preferred Method

Instead of using the method testConnectionToDataSource , use the method testConnection and pass in the configuration ID of the data source.

set myds [$AdminConfig getid "/JDBCProvider:Sybase 12.0 JDBC Driver/DataSource:sybaseds/"]
$AdminControl invoke $dshelper testConnection $myds
To aid in making a batch program, the command returns a value instead of a message. A return value of 0 means success. A return value of 1 - n means success, but with a number of warnings. If the process fails, you receive an exception message.