<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/styles/XMLStylesDoc_xhtml11_en.xsl"?><!DOCTYPE document SYSTEM "/schemas/XMLStyles10.dtd">
<document xmlns="http://XMLStyles.com/namespaces/styles" xmlns:xst="http://XMLStyles.com/namespaces/styles" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:date="http://exslt.org/dates-and-times">
   <noxml>
      <p xmlns="http://www.w3.org/1999/xhtml"/>
      <!-- You are viewing the source.  The following message should be ignored if you did "View Source" in your browser. -->
      <p xmlns="http://www.w3.org/1999/xhtml">
ATTENTION: XML WEB PAGES NOT SUPPORTED
   If you see this message, your current browser does not support the
   1999 XSLT 1.0 (or later) standard for XML web pages such as this one.
   Please upgrade your browser to a newer version
   that supports 1999 or later standards such as:
      Mozilla Firefox version 1.0.2 or later (GetFirefox -&gt; http://www.GetFirefox.com/)
      Netscape version 8 or later
      Safari version 1.3 or later
      Opera version 9 or later
      Microsoft Internet Explorer (MSIE) version 5 or later
   For further assistance, contact the software vendor for your browser.
   To go to the X<!-- extended HTML -->HTML version of this page click the following link:
<a href="index.html">index.html</a>
      </p>
      <p xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
   </noxml>
   <path>/computers/databases/derby/</path>
   <site>How To Guides</site>
   <logo xlink:type="simple" xlink:href="/images/howtohome.jpg" media="screen" width="240" height="34">How To Guides</logo>
   <logo xlink:type="simple" xlink:href="/images/howtoguides.jpg" media="print" width="240" height="34">How To Guides</logo>
   <logo xlink:type="simple" xlink:href="/images/howtoguidesmobile.jpg" media="handheld" width="150" height="17">How To Guides</logo>
   <navigation where="sections">
      <label>How To Guides</label>
      <link xlink:type="simple" xlink:href="/business/index.xml">Business</link>
      <link xlink:type="simple" xlink:href="/computers/index.xml">Computers</link>
      <link xlink:type="simple" xlink:href="/computers/databases/index.xml">Databases</link>
      <link xlink:type="simple" xlink:href="/internet/index.xml">Internet</link>
      <link xlink:type="simple" xlink:href="/mobile/index.xml">Mobile</link>
      <link xlink:type="simple" xlink:href="/money/index.xml">Money</link>
      <link xlink:type="simple" xlink:href="/movies/index.xml">Movies</link>
      <link xlink:type="simple" xlink:href="/computers/os/index.xml">Operating Systems</link>
   </navigation>
   <navigation where="up">
      <link xlink:type="simple" xlink:href="../../">Computers</link>
      <link xlink:type="simple" xlink:href="../">Databases</link>
   </navigation>
   <navigation where="subsections">
      <link xlink:type="simple" xlink:href="/computers/databases/design.xml">Design</link>
      <link xlink:type="simple" xlink:href="/computers/databases/tuning.xml">Tuning</link>
      <link xlink:type="simple" xlink:href="index.xml">Apache Derby</link>
      <link xlink:type="simple" xlink:href="/computers/databases/ibmdb2/">IBM DB2</link>
      <link xlink:type="simple" xlink:href="/computers/databases/mysql/">MySQL</link>
      <link xlink:type="simple" xlink:href="/computers/databases/oracle/">Oracle</link>
      <link xlink:type="simple" xlink:href="/computers/databases/sqlserver/">SQL Server</link>
   </navigation>
   <section id="body" type="body">
      <pages name="index">
         <title>How To Guides for MySQL</title>
         <label>MySQL</label>
         <navigation where="pages">
            <label>MySQL</label>
            <link xlink:type="simple" xlink:href="index.xml">Summary</link>
            <link xlink:type="simple" xlink:href="commands.xml">Commands</link>
         </navigation>
         <h1>"How To" Guides for MySQL</h1>
         <page id="N1008D" name="commands">
            <title>MySQL client commands</title>
            <label>Commands</label>
            <description/>
            <navigation where="up">
               <link xlink:type="simple" xlink:href="index.xml">MySQL</link>
            </navigation>
            <subpage id="N1009A" name="ijcmd">
               <h1>Start the Derby Interactive SQL Tool</h1>
               <blockcode>
                  <l>java -cp "c:\jdk1.6.0_01\db\lib\derby.jar;c:\jdk1.6.0_01\db\lib\derbytools.jar" org.apache.derby.tools.ij</l>
                  <l>​<span class="output">ij version 10.2</span>
                  </l>
                  <l>​<span class="output">ij&gt; </span>
                  </l>
               </blockcode>
            </subpage>
            <subpage id="N100AD" name="infocmds">
               <h1>Show available commands</h1>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>help;</l>
               </blockcode>
            </subpage>
            <subpage id="N100B8" name="conncmds">
               <h1>Connection commands</h1>
               <p>Create a database:</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>connect 'jdbc:derby:C:/Documents and Settings/<i>username</i>/.derby/<i>dbname</i>;create=true';</l>
               </blockcode>
               <p>To drop a database, simply remove the directory:</p>
               <blockcode>
                  <l>rmdir /s "%USERPROFILE%\.derby\<i>dbname</i>"</l>
               </blockcode>
               <p>Connect to an existing database:</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>connect 'jdbc:derby:C:/Documents and Settings/<i>username</i>/.derby/<i>dbname</i>';</l>
                  <l>​<span class="output">ij&gt; </span>connect 'jdbc:derby:C:/Documents and Settings/<i>username</i>/.derby/<i>dbname</i>' as <i>connname</i>;</l>
               </blockcode>
               <p>The default connection name is "CONNECTION<i>n</i>", where <i>n</i> is numeric.
               </p>
               <p>Show information about established connections:</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>show connections;</l>
               </blockcode>
               <p>Switch to a different connection:</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>set <i>connname</i>;</l>
               </blockcode>
               <p>Disconnect a connection:</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>disconnect current;</l>
                  <l>​<span class="output">ij&gt; </span>disconnect <i>connname</i>;</l>
               </blockcode>
            </subpage>
            <subpage id="N10120" name="schemacmds">
               <h1>Schema commands</h1>
               <p>Create a schema</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>create schema <i>schemaname</i>;</l>
                  <l>​<span class="output">ij&gt; </span>create schema "<i>SchemaName</i>";</l>
               </blockcode>
               <p>Show available schemas</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>show schemas;</l>
               </blockcode>
               <p>Change schemas</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>set current sqlid <i>schemaname</i>;</l>
                  <l>​<span class="output">ij&gt; </span>set current sqlid = "<i>SchemaName</i>";</l>
               </blockcode>
            </subpage>
            <subpage id="N10157" name="tablecmds">
               <h1>Commands for Tables in Database</h1>
               <p>Show tables in schema</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>show tables in sys;</l>
                  <l>​<span class="output">ij&gt; </span>show tables in <i>schemaname</i>;</l>
                  <l>​<span class="output">ij&gt; </span>show tables in "<i>SchemaName</i>";</l>
               </blockcode>
               <p>Similarly, "views", "procedures" "synonyms" and "indexes" can also be displayed.
               </p>
               <p>Show indexes for a table</p>
               <blockcode>
                  <l>​<span class="output">ij&gt; </span>show indexes from <i>tablename</i>;</l>
                  <l>​<span class="output">ij&gt; </span>show indexes from <i>schemaname</i>.<i>tablename</i>;</l>
                  <l>​<span class="output">ij&gt; </span>show indexes from "<i>SchemaName</i>"."<i>TableName</i>";</l>
               </blockcode>
            </subpage>
            <updated local="2009-01-31">Saturday January 31, 2009</updated>
         </page>
      </pages>
   </section>
   <copyright>Copyright © 2006 How To Guides .com. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.</copyright>
   <disclaimer>All information, links, forms, applications and other items on this site or obtained from it are provided <b>AS IS</b>, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</disclaimer>
   <ids urchin="UA-779578-2"/>
</document>

