Test data source connections using scripting



  1. Start wsadmin

  2. Identify the DataSourceCfgHelper MBean and assign it to the dshelper variable.

    Example output:

    WASX7217I: Connection to provided datasource was successful.

  3. Test the connection. The following example invokes the testConnectionToDataSource operation on the MBean, passing in the classname, userid, password, database name, JDBC driver class path, language, and country.

    • Jacl:

      $AdminControl invoke $dshelper testConnectionToDataSource "COM.ibm.db2.jdbc.DB2XADataSource db2admin db2admin {{databaseName sample}} c:/sqllib/java/db2java.zip en US"

    • Jython:

      print AdminControl.invoke(dshelper, 'testConnectionToDataSource',  'COM.ibm.db2.jdbc.DB2XADataSource dbuser1 dbpwd1 "{{databaseName jtest1}}" c:/sqllib/java12/db \"\" \"\"')

    Example output:

    WASX7217I: Connection to provided data source was successful.


See Also

AdminControl object for scripted administration


See Also

Commands for the AdminControl object