[Version 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.

[Version 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. The testConnection method is not available in V5.0. The data source to be tested has to be saved in the master configuration.

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.




Searchable topic ID:   rxml_testconnection
Last updated: Jun 21, 2007 4:12:58 PM CDT    WebSphere Application Server Express, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.exp.doc/info/exp/ae/rxml_testconnection.html

Library | Support | Terms of Use | Feedback