Before you begin
Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.Why and when to perform this task
Perform the following steps to test a data source to ensure a connection to the database.
Steps for this task
set ds [$AdminConfig getid /DataSource:DS1/] $AdminControl testConnection $ds
ds = AdminConfig.getid('/DataSource:DS1/') AdminControl.testConnection(ds)
WASX7217I: Connection to provided datasource was successful.
Using Jacl:
$AdminControl invoke $dshelper testConnectionToDataSource "COM.ibm.db2.jdbc.DB2XADataSource db2admin db2admin {{databaseName sample}} c:/sqllib/java/db2java.zip en US"
Using Jython:
print AdminControl.invoke(dshelper, 'testConnectionToDataSource', 'COM.ibm.db2.jdbc.DB2XADataSource dbuser1 dbpwd1 "{{databaseName jtest1}}" c:/sqllib/java12/db \"\" \"\"')
WASX7217I: Connection to provided data source was successful.
Related concepts
AdminControl object for scripted administration
Related reference
Commands for the AdminControl object