35 lines
1.4 KiB
HTML
35 lines
1.4 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
||
|
|
||
|
<title>Testing a connection using wsadmin</title>
|
||
|
</head>
|
||
|
|
||
|
<BODY>
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
<h6><a name="datatestwsadmin"></a>Testing a connection using wsadmin</h6>
|
||
|
|
||
|
<p>The AdminControl object of wsadmin has a testConnection operation that tests the configuration properties of a data source object. It takes a configuration ID as an argument.</p>
|
||
|
|
||
|
<p><strong>Note:</strong> This invocation style is currently supported only for databases that do not require a user ID and password to make a connection.</p>
|
||
|
|
||
|
<p>To test a connection using wsadmin, perform the following steps:</p>
|
||
|
|
||
|
<ol>
|
||
|
<li><p>Invoke the getid method for your data source.</p></li>
|
||
|
<li><p>Set the value of the configuration id to a variable.</p>
|
||
|
<pre>set myds [$AdminConfig getid <em>/JDBCProvider:mydriver/DataSource:mydatasrc/]</em></pre>
|
||
|
<p>where <em>/JDBCProvider:mydriver/DataSource:mydatasrc/</em> is the data source you want to test. After you have the configuration ID of the data source, you can test the connection to the database.</p>
|
||
|
</li>
|
||
|
<li><p>Test the connection to the database.</p>
|
||
|
<pre>$AdminControl testConnection $myds</pre>
|
||
|
</li>
|
||
|
</ol>
|
||
|
|
||
|
</body>
|
||
|
</html>
|