# Dbscript.html Sample

This topic inludes the source code for the Dbscript.html Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/DBScripter/docs/help/doc/en/partners/DBScripter/javadoc-tag/jc/

## Sample Source Code

    <!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">

    <html><!-- InstanceBegin template="/Templates/Tag.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>@jc:dbscript Annotation</title>
    <!-- InstanceEndEditable -->

    <!--(Meta)==========================================================-->
    <meta http-equiv=Content-Type content="text/html; charset=$CHARSET;">
    <meta name=workshop content=WWKSHOP>
    <!-- InstanceBeginEditable name="metatags" -->
    <!-- In the component metatag, please indicate whether this topic is for Integration, Workshop, or Portal. -->
    <meta name="component" content>
    <!-- In the description metatag, please provide a BRIEF description of the topic contents. -->
    <meta name="description" content>
    <!-- In the component metatag, please list keywords that will help a user search for this topic. -->
    <meta name="keywords" content>

    <!-- InstanceEndEditable -->

    <!--(Links)=========================================================-->
    <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
    <link href="../../../../workshop.css" rel="stylesheet" type="text/css">
    <a href="../../../../core/index.html" id="index"></a>
    <script language="JavaScript" src="../../../../core/topicInfo.js"></script>
    <script language="JavaScript" src="../../../../core/CookieClass.js"></script>
    <script language="JavaScript" src="../../../../core/displayContent.js"></script>
    </head>

    <!--(Body)==========================================================-->
    <body>
    <script language="JavaScript">
    displayInFrames();
    </script>
    <!-- InstanceBeginEditable name="body" -->
    <div id="topictitle">
      <h1 class="Title">@jc:dbscript Annotation</h1>
    </div>
    <div id="topictext">
      <p>Annotation on a method of a DBScriptRunner control JCX methods that determine whether the method a) defines a data source, b) runs a built-in script, or c) runs a script pointed to by a file.</p>
      <h2>Syntax</h2>

      <p class="syntax">@jc:dbscript</p>

      <p class="syntaxindent">new-data-source-type=&quot;<span class="syntaxpartname">&lt;data-source-type&gt;</span>&quot;</p>
      <p class="syntaxindent">new-data-source-name=&quot;<span class="syntaxpartname">&lt;data-source-name&gt;</span>&quot;</p>
      <p class="syntaxindent">data-source-url-defaults=&quot;<span class="syntaxpartname">&lt;data-source-url&gt;</span>&quot;</p>
      <p class="syntaxindent">data-source-properties=&quot;<span class="syntaxpartname">&lt;data-source-properties&gt;</span>&quot;</p>
      <p class="syntaxindent">prompt-for-url=&quot;<span class="syntaxpartname">true</span> | <span class="syntaxpartname">false</span>&quot;</p>
      <p class="syntaxindent">prompt-for-username=&quot;<span class="syntaxpartname">true</span> | <span class="syntaxpartname">false</span>&quot;</p>
      <p class="syntaxindent">create-notx-datasource=&quot;<span class="syntaxpartname">true</span> | <span class="syntaxpartname">false</span>&quot;</p>
      <p class="syntaxindent">wls-admin-user=&quot;<span class="syntaxpartname">&lt;username&gt;</span>&quot;</p>
      <p class="syntaxindent">wls-admin-pwd=&quot;<span class="syntaxpartname">&lt;password&gt;</span>&quot;</p>
      <p class="syntaxindent">script-file=&quot;<span class="syntaxpartname">&lt;file-path&gt;</span>&quot;</p>

      <h2>Attributes</h2>

      <p class="attribute"><a name="new-data-source-type"></a>new-data-source-type</p>
      <p class="partdesc">Type of datasource to create. If present, signals that this method defines a JDBC connection pool and one or two datasources. The JDBC driver class is determined by this attribute.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <p class="attribute"><a name="new-data-source-name"></a>new-data-source-name</p>
      <p class="partdesc">Name of datasource to create.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <p class="attribute"><a name="data-source-url-defaults"></a>data-source-url-defaults</p>
      <p class="partdesc">URL of datasource to create, if not provided as method parameters.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <p class="attribute"><a name="data-source-properties"></a>data-source-properties</p>
      <p class="partdesc">Properties of datasource to create, if not provided as method parameters.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <p class="attribute"><a name="prompt-for-url"></a>prompt-for-url</p>
      <p class="partdesc">True if parts of URL for datasource are not provided as method parameters.</p>
      <p class="partdesc">Default: <span class="langinline">false</span>.</p>

      <p class="attribute"><a name="prompt-for-username"></a>prompt-for-username</p>
      <p class="partdesc">True if database username and password for datasource are not provided as method parameters.</p>
      <p class="partdesc">Default: <span class="langinline">false</span>.</p>

      <p class="attribute"><a name="create-notx-datasource"></a>create-notx-datasource</p>
      <p class="partdesc">Whether to create a second datasource that does not participate in global transactions (useful for scripts).</p>
      <p class="partdesc">Default: <span class="langinline">false</span>.</p>

      <p class="attribute"><a name="wls-admin-user"></a>wls-admin-user</p>
      <p class="partdesc">Username of WebLogic Server admin with permission to create datasources.  Used at runtime only.  Leave blank if application forces logon.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <p class="attribute"><a name="wls-admin-pws"></a>wls-admin-pws</p>
      <p class="partdesc">Password of WebLogic Server admin with permission to create datasources.  Used at runtime only.  Leave blank if application forces logon.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <p class="attribute"><a name="script-file"></a>script-file</p>
      <p class="partdesc">A SQL script file compiled into the jar.</p>
      <p class="partdesc">Default: <span class="langinline">none</span>.</p>

      <h2>Remarks</h2>
      <p>The following rules apply to this annotation's use:</p>
    </div>
    <ul>
      <li>
        <div>
          A single <span class="langinline">@jc:dbscript</span> annotation may
          appear within a single Javadoc comment block.
        </div>
      </li>
      <li>
        <div>
          Required in front of each method in a DBScriptRunner control JCX file.
        </div>
      </li>
    </ul>
    </ul>
    <div>
      <!-- class=content -->
      <p class="relatedtopics">Related Topics</p>
      <p><a href="dbscr-connection.html">@jc:dbscr-connection Annotation</a></p>
      <p><a href="../../navDBScriptRunner.html">DBScriptRunner Control</a></p>
      <!-- class=content -->
    </div>
    <!-- InstanceEndEditable -->
    <script language="JavaScript">
    writeTopicInfo();
    </script>
    </body>
    <!-- InstanceEnd --></html>