<!--Arbortext, Inc., 1988-2007, v.4002-->
<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD SolBook 3.5//EN" [
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY % commonents SYSTEM "common.ent">
%commonents;
]>
<?Pub UDT _bookmark _target>
<?Pub CX solbook(>
<refentry id="add-resources-1"><?Pub Tag atict:info tracking="off" ref="2"><?Pub Tag
atict:user user="hl34125" fullname=""><?Pub Tag atict:user user="pmdavies"
fullname=""><?Pub Tag atict:user user="ah95648" fullname="">
<!-- @(#)add-resources.1 1.10 07/04/25 SMI; -->
<refmeta><refentrytitle>add-resources</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">30 Jan 2007</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&software;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">Copyright (c) 2007, Sun Microsystems, Inc.
All Rights Reserved</refmiscinfo>
</refmeta>
<refnamediv><indexterm><primary>add-resources</primary></indexterm><indexterm>
<primary>registers the resource in the XML file specified</primary></indexterm>
<refname>add-resources</refname><refpurpose>creates the resources specified
in an XML file</refpurpose></refnamediv>
<refsynopsisdiv><title></title>
<synopsis><command>add-resources</command> &synopsis-common; [<option
role="double-dash">target</option> <replaceable>target</replaceable>]
 <replaceable>xml_file_path</replaceable></synopsis>
</refsynopsisdiv>
<refsect1 role="description"><title></title>
<para>The <command>add-resources</command> command creates the resources named
in the specified XML file. The <replaceable>xml_file_path</replaceable> is
the path to the XML file containing the resources to be created. The <literal>DOCTYPE
</literal> must be specified as <ulink
url="http://www.sun.com/software/appserver/dtds/sun-resources_1_2.dtd" type="url"></ulink>in
the <filename>resources.xml</filename> file.</para>
<para>This command is supported in remote mode only.</para>
</refsect1>
<refsect1 role="options"><title></title>
<variablelist termlength="medium">&options-common;
<varlistentry><term><option role="double-dash">target</option></term>
<listitem><para>Specifies the target for which you are creating the resources.
Valid values are</para>
<itemizedlist>
<listitem><para><literal>server</literal>&hyphen; Specifies the default server
instance as the target for creating the resource. <literal>server</literal> is
the name of the default server instance and is the default value for this
option. </para></listitem>
<listitem><para><literal>domain</literal>&hyphen; Specifies a particular domain
as the target for creating the resource.</para></listitem>
<listitem><para><replaceable>cluster_name</replaceable>&hyphen; Specifies
a particular cluster as the target for creating the resource.</para></listitem>
<listitem><para><replaceable>instance_name</replaceable>&hyphen; Specifies
a particular server instance as the target for creating the resource.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="operands"><title></title>
<variablelist termlength="medium">
<varlistentry><term><replaceable>xml_file_path</replaceable></term>
<listitem><para>The path to the XML file containing the resource(s) to be
created. The XML file must reside in the <filename><replaceable>&lt;install-dir></replaceable>/domains/domain1/config
</filename> directory. If you specify a relative path or simply provide the
name of the XML file, this command will prepend <filename><replaceable>&lt;install-dir>
</replaceable>/domains/domain1/config</filename> to this operand. </para>
<para>An example XML file follows. </para>
</listitem>
</varlistentry>
</variablelist>
<screen>&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;!DOCTYPE resources PUBLIC 
   "-//Sun Microsystems Inc.//DTD Sun GlassFish Communications Server<?Pub
Caret> Domain//EN" 
   "*http://www.sun.com/software/appserver/dtds/sun-resources_1_2.dtd*">

&lt;resources>
 &lt;jdbc-connection-pool name="SPECjPool" steady-pool-size="100" 
   max-pool-size="150" max-wait-time-in-millis="60000" 
   pool-resize-quantity="2" idle-timeout-in-seconds="300" 
   is-isolation-level-guaranteed="true" 
   is-connection-validation-required="false" 
   connection-validation-method="auto-commit" 
   fail-all-connections="false" 
   datasource-classname="oracle.jdbc.pool.OracleDataSource">
  &lt;property name="URL" 
    value="jdbc:oracle:thin:@iasperfsol12:1521:specdb"/>
  &lt;property name="User" value="spec"/>
  &lt;property name="Password" value="spec"/>
  &lt;property name="MaxStatements" value="200"/>
  &lt;property name="ImplicitCachingEnabled" value="true"/>
 &lt;/jdbc-connection-pool>
 &lt;jdbc-resource enabled="true" pool-name="SPECjPool" 
   jndi-name="jdbc/SPECjDB"/> 
&lt;/resources></screen>
</refsect1>
<refsect1 role="examples"><title></title>
<example><title>Using the add-resources command</title>
<para>The following command creates resources using the contents of the XML
file <filename>resource.xml</filename>:</para>
<screen>asadmin> <userinput>add-resources --user admin --passwordfile passwords.txt 
--host localhost --port 4848 resource.xml</userinput>
 =========================
Added Resource Type: jdbc-connection-pool
 =========================
Added Resource Type: jdbc-resource
 =========================
Added Resource Type: persistence-manager-factory-resource
Command add-resources executed successfully.

</screen>
</example>
</refsect1>
<refsect1 role="exit-status"><title></title>
<variablelist termlength="medium">
<varlistentry><term>0</term>
<listitem><para>command executed successfully</para>
</listitem>
</varlistentry>
<varlistentry><term>1</term>
<listitem><para>error in executing the command</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="see-also"><title></title>
<para><olink targetdoc="asrefman" targetptr="create-jdbc-connection-pool-1">create-jdbc-connection-pool(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-jdbc-resource-1">create-jdbc-resource(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-jms-resource-1">create-jms-resource(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-jndi-resource-1">create-jndi-resource(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-javamail-resource-1">create-javamail-resource(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-persistence-resource-1">create-persistence-resource(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-custom-resource-1">create-custom-resource(1)
</olink></para>
</refsect1>
</refentry>
<?Pub *0000006420 0>
