db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r355248 [2/3] - in /db/derby/site/trunk: build/site/ build/site/papers/ build/site/papers/DerbyTut/ build/site/skin/ src/documentation/ src/documentation/content/xdocs/ src/documentation/content/xdocs/papers/ src/documentation/content/xdocs...
Date Thu, 08 Dec 2005 22:30:16 GMT
Added: db/derby/site/trunk/build/site/papers/DerbyTut/ns_intro.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/DerbyTut/ns_intro.html?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/build/site/papers/DerbyTut/ns_intro.html (added)
+++ db/derby/site/trunk/build/site/papers/DerbyTut/ns_intro.html Thu Dec  8 14:30:05 2005
@@ -0,0 +1,693 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.7">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Step 4: Derby Network Server</title>
+<link type="text/css" href="../../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../../skin/profile.css" rel="stylesheet">
+<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../../">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> &gt; <a href="http://db.apache.org/">db</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<div class="header">
+<div class="grouplogo">
+<a href="http://db.apache.org"><img class="logoImage" alt="" src="../../images/db-logo-white.png" title=""></a>
+</div>
+<div class="projectlogo">
+<a href="http://db.apache.org/derby/"><img class="logoImage" alt="Derby" src="../../images/derby-logo.jpg" title="Derby is a zero admin Java RDBMS."></a>
+</div>
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
+                    <input attr="value" name="Search" value="Search" type="submit">
+</form>
+</div>
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../../index.html">Home</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../derby_comm.html">Community</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../manuals/index.html">Manuals</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../../papers/index.html">Papers</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../integrate/index.html">Integration</a>
+</li>
+</ul>
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<div id="level2tabs"></div>
+<script type="text/javascript"><!--
+document.write("<text>Last Published:</text> " + document.lastModified);
+//  --></script>
+</div>
+<div class="breadtrail">
+             
+             &nbsp;
+           </div>
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Papers</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="../../papers/index.html">Index</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/derby_web.html">Derby Web Site</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/db-derby/DerbyInstruction">Instruction</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.5', '../../skin/')" id="menu_selected_1.1.5Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Derby Tutorial</div>
+<div id="menu_selected_1.1.5" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="../../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Step 4: Derby Network Server</div>
+</div>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.2', '../../skin/')" id="menu_1.2Title" class="menutitle">Derby Engine</div>
+<div id="menu_1.2" class="menuitemgroup">
+<div onclick="SwitchMenu('menu_1.2.1', '../../skin/')" id="menu_1.2.1Title" class="menutitle">Javadoc</div>
+<div id="menu_1.2.1" class="menuitemgroup">
+<div class="menuitem">
+<a href="http://db.apache.org/derby/javadoc/engine">Engine</a>
+</div>
+<div class="menuitem">
+<a href="http://db.apache.org/derby/javadoc/language">Language</a>
+</div>
+<div class="menuitem">
+<a href="http://db.apache.org/derby/javadoc/tools">Tools</a>
+</div>
+<div class="menuitem">
+<a href="http://db.apache.org/derby/javadoc/publishedapi">API</a>
+</div>
+</div>
+<div class="menuitem">
+<a href="../../papers/derby_arch.html">Architecture</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/btree_package.html">BTree</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/pageformats.html">Disk Page Format</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/derby_htw.html">How Things Work</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/Intersect-design.html">Intersect &amp; Except</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/JDBCImplementation.html">JDBC</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/logformats.html">Log Format</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/recovery.html">Logging &amp; Recovery</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/optimizer.html">Optimizer</a>
+</div>
+<div class="menuitem">
+<a href="http://svn.apache.org/repos/asf/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/package.html">Type System</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/versionupgrade.html">Versioning</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.3', '../../skin/')" id="menu_1.3Title" class="menutitle">Derby Network Client</div>
+<div id="menu_1.3" class="menuitemgroup">
+<div class="menuitem">
+<a href="../../papers/DerbyClientSpec.html">Functional Spec</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.4', '../../skin/')" id="menu_1.4Title" class="menutitle">Presentations</div>
+<div id="menu_1.4" class="menuitemgroup">
+<div class="menuitem">
+<a href="../../papers/MiscPresentations.html#OSCON+2005">OSCON 2005</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/ApacheConUs04.html">ApacheCon US '04</a>
+</div>
+<div class="menuitem">
+<a href="../../papers/MiscPresentations.html#Colorado+Software+Summit+2004">Colorado 2004</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<div id="credit2"></div>
+</div>
+<div id="content">
+<div class="trail">
+<text>Font size:</text> 
+	          &nbsp;<input value="Reset" class="resetfont" title="Reset text" onclick="ndeSetTextSize('reset'); return false;" type="button">      
+	          &nbsp;<input value="-a" class="smallerfont" title="Shrink text" onclick="ndeSetTextSize('decr'); return false;" type="button">
+	          &nbsp;<input value="+a" class="biggerfont" title="Enlarge text" onclick="ndeSetTextSize('incr'); return false;" type="button">
+</div>
+<h1>Step 4: Derby Network Server</h1>
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#ns_intro">Introduction</a>
+</li>
+<li>
+<a href="#ns">Derby Network Server</a>
+<ul class="minitoc">
+<li>
+<a href="#ns_config_env">Configure environment</a>
+</li>
+<li>
+<a href="#start_ns">Start Network Server</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#ns_sample">Sample Application</a>
+<ul class="minitoc">
+<li>
+<a href="#configure_ns_client">Configure environment to use Derby Network Client JDBC driver</a>
+</li>
+<li>
+<a href="#ij_ns_client">Test network server connection with ij</a>
+</li>
+<li>
+<a href="#copy_ns_client">Copy sample application</a>
+</li>
+<li>
+<a href="#ns_lookat_code">A quick look at the code</a>
+<ul class="minitoc">
+<li>
+<a href="#jdbc_ns_client">Load the Client JDBC Driver</a>
+</li>
+<li>
+<a href="#url_ns_client">Get a Network Server Connection</a>
+</li>
+<li>
+<a href="#ns_client_noshutdown">Don't shut Derby down</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#compile_ns_client">Compile Sample Application</a>
+</li>
+<li>
+<a href="#run_ns_client">Run Sample Application</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#stop_ns">Stop Network Server</a>
+</li>
+<li>
+<a href="#ns_next_steps">Next Steps</a>
+<ul class="minitoc">
+<li>
+<a href="#Network+Server+Options">Network Server Options</a>
+</li>
+<li>
+<a href="#Embedded+Server">Embedded Server</a>
+</li>
+</ul>
+</li>
+</ul>
+</div> 
+
+
+<a name="N1000C"></a><a name="ns_intro"></a>
+<h2 class="boxed">Introduction</h2>
+<div class="section">
+<p>
+The "<a href="embedded_intro.html">Embedded Derby</a>" section
+shows how two applications running in different JVMs,
+<span class="codefrag">ij</span> and <span class="codefrag">SimpleApp</span>,
+can't use the Derby Embedded JDBC driver to connect
+to the same <span class="codefrag">derbyDB</span> database simultaneously
+because only one JVM can access a given database.
+</p>
+<p>
+The solution is to introduce a framework that embeds Derby and handles
+database requests from multiple applications.
+The Derby Network Server is such a framework. It is a embedded Derby 
+application that manages requests from network clients,
+as depicted in Figure 2.
+</p>
+<p>
+
+<strong>Figure 2: Derby Network Server Architecture</strong>
+
+</p>
+<p>
+
+<img alt="Figure 2: Derby Network Server Architecture" src="network_server.png">
+</p>
+<p>
+This section shows how to start the Derby Network Server,
+configure your environment to use the Derby Network Client JDBC driver,
+and compile and run a simple Java application that uses the network server.
+The information presented here is minimal, just enough to help get new 
+users started.
+For complete information, see part one of the
+<a href="http://db.apache.org/derby/manuals">Derby Server and 
+Administration Guide</a>.
+</p>
+</div>
+
+
+<a name="N1003A"></a><a name="ns"></a>
+<h2 class="boxed">Derby Network Server</h2>
+<div class="section">
+<p>
+   First set the
+   <a href="install_software.html#set_derby_install">DERBY_INSTALL</a>
+   environment variable.
+</p>
+<a name="N10047"></a><a name="ns_config_env"></a>
+<h3 class="boxed">Configure environment</h3>
+<p>To start or stop the Network Server,
+      set your <span class="codefrag">CLASSPATH</span> to include the jar files listed below:</p>
+<ul>
+     
+<li> 
+<span class="codefrag">derby.jar</span>: contains the Derby engine </li>
+     
+<li> 
+<span class="codefrag">derbynet.jar</span>: contains the code for
+   the Derby Network Server
+     </li>
+
+</ul>
+<p>
+   You can set your <span class="codefrag">CLASSPATH</span> explicitly with the command
+   shown below:
+</p>
+<p class="code-block">Windows:
+C:\&gt; set CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbytools.jar;%DERBY_INSTALL%\lib\derbynet.jar;.
+</p>
+<p class="code-block">UNIX:
+$ export CLASSPATH=$DERBY_INSTALL/lib/derby.jar:$DERBY_INSTALL/lib/derbytools.jar:$DERBY_INSTALL\lib\derbynet.jar:.
+</p>
+<p>
+   You can also use the script that the Derby software distribution provides 
+   to set <span class="codefrag">CLASSPATH</span>.
+   Change directory to the
+   <span class="codefrag">DERBY_INSTALL/frameworks/NetworkServer/bin</span> directory,
+    then execute
+   <span class="codefrag">setNetworkServerCP.bat</span> (Windows) or
+     <span class="codefrag">setNetworkServerCP.ksh</span> (UNIX), as shown below:
+   </p>
+<p class="code-block">Windows:
+C:\&gt; cd %DERBY_INSTALL%\frameworks\NetworkServer\bin
+C:\Apache\db-derby-10.1.2.1-bin\frameworks\NetworkServer\bin&gt; setNetworkServerCP.bat
+</p>
+<p class="code-block">UNIX:
+$ cd $DERBY_INSTALL/frameworks/NetworkServer/bin
+$ . setNetworkServerCP.ksh
+</p>
+<a name="N10088"></a><a name="start_ns"></a>
+<h3 class="boxed">Start Network Server</h3>
+<p>
+Start the Network server by executing the
+<span class="codefrag">startNetworkServer.bat</span> (Windows) or
+<span class="codefrag">startNetworkServer.ksh</span> (UNIX) script.
+This will start the Network Server up on port 1527 and echo a startup
+message:
+</p>
+<p class="code-block">Windows:
+C:\Apache\db-derby-10.1.2.1-bin\frameworks\NetworkServer\bin&gt; startNetworkServer.bat
+Server is ready to accept connections on port 1527.
+</p>
+<p class="code-block">UNIX:
+$ startNetworkServer.ksh
+Server is ready to accept connections on port 1527.
+</p>
+<p>
+Messages will continue to be output to this window as the Network Server
+processes connection requests.
+</p>
+<p>
+The Network Server starts Derby, so you'll find the <span class="codefrag">derby.log</span>
+error log in the directory where you start the Network Server.
+</p>
+</div>
+
+
+<a name="N100AA"></a><a name="ns_sample"></a>
+<h2 class="boxed">Sample Application</h2>
+<div class="section">
+<p>
+   Open a new window and set the
+   <a href="install_software.html#set_derby_install">DERBY_INSTALL</a>
+   environment variable.
+</p>
+<a name="N100B7"></a><a name="configure_ns_client"></a>
+<h3 class="boxed">Configure environment to use Derby Network Client JDBC driver</h3>
+<p>To use the Derby Network Client JDBC driver,
+      set your <span class="codefrag">CLASSPATH</span> to include the jar files listed below:</p>
+<ul>
+     
+<li> 
+<span class="codefrag">derbyclient.jar</span>: contains the JDBC driver
+     </li>
+     
+<li> 
+<span class="codefrag">derbytools.jar</span>:
+           optional, provides the <span class="codefrag">ij</span> tool</li>
+
+</ul>
+<p>
+   You can set your <span class="codefrag">CLASSPATH</span> explicitly with the command
+   shown below:
+</p>
+<p class="code-block">Windows:
+C:\&gt; set CLASSPATH=%DERBY_INSTALL%\lib\derbyclient.jar;%DERBY_INSTALL%\lib\derbytools.jar;.
+</p>
+<p class="code-block">UNIX:
+$ export CLASSPATH=$DERBY_INSTALL/lib/derbyclient.jar:$DERBY_INSTALL/lib/derbytools.jar:.
+</p>
+<p>
+   You can also use the script that the Derby software distribution provides 
+   to set <span class="codefrag">CLASSPATH</span>.
+   Change directory to the
+   <span class="codefrag">DERBY_INSTALL/frameworks/NetworkServer/bin</span> directory,
+    then execute
+    the <span class="codefrag">setNetworkClientCP.bat</span> (Windows) or
+     <span class="codefrag">setNetworkClientCP.ksh</span> (UNIX) script as shown below:
+    </p>
+<p class="code-block">Windows:
+C:\Apache\db-derby-10.1.2.1-bin\frameworks\NetworkServer\bin&gt; setNetworkClientCP.bat
+</p>
+<p class="code-block">UNIX:
+$ . setNetworkClientCP.ksh
+</p>
+<a name="N100FB"></a><a name="ij_ns_client"></a>
+<h3 class="boxed">Test network server connection with ij</h3>
+<p>
+   An <strong>embedded</strong> 
+   connection URL that creates and connects to a database
+   looks like this:
+   </p>
+<p class="code-block">java org.apache.derby.tools.ij
+ij&gt; connect 'jdbc:derby:MyDbTest;create=true';</p>
+<p>
+   A Derby Network Client connection URL is very close; just add
+   <span class="codefrag">//localhost:1527/</span> before the database name:
+   </p>
+<p class="code-block">java org.apache.derby.tools.ij
+ij&gt; connect 'jdbc:derby://localhost:1527/MyDbTest;create=true';</p>
+<p>
+   Where is the physical location of the newly created database?
+   </p>
+<p>
+   If you use the embedded driver, by default the database is created
+   in the same directory in which <span class="codefrag">ij</span> was started up.
+   If you use the Derby Network Client JDBC driver, 
+   by default the database is created
+   in the directory where the Network Server was started up; 
+   in other words, in
+   <span class="codefrag">DERBY_INSTALL/frameworks/NetworkServer/bin</span>.
+   </p>
+<p>
+   Derby provides many ways to specify the actual location.
+   For example, the connection URL below specifies a full path for the database
+   location:
+   </p>
+<p class="code-block">java org.apache.derby.tools.ij
+ij&gt; connect 'jdbc:derby://localhost:1527//home/bill/DerbyDb/MyDbTest;create=true';</p>
+<p>
+   The <em>Developer's Guide</em> provides information
+   about where Derby looks for databases:
+   </p>
+<ul>
+      
+<li>
+<a href="http://db.apache.org/derby/docs/dev/devguide/cdevdvlp34964.html">Connecting to databases</a>
+</li>
+      
+<li> 
+<a href="http://db.apache.org/derby/docs/dev/devguide/cdevdvlp13018.html">Defining the system directory</a>
+</li>
+   
+</ul>
+<a name="N1013D"></a><a name="copy_ns_client"></a>
+<h3 class="boxed">Copy sample application</h3>
+<p>
+   This section uses the same sample application that the 
+   "<a href="embedded_intro.html">Embedded Derby</a>" section uses.
+   Copy that application
+   into your current directory as shown below:
+   </p>
+<p class="code-block">Windows:
+c:\&gt; copy %DERBY_INSTALL%\demo\simple\SimpleApp.java .
+</p>
+<p class="code-block">UNIX:
+cp $DERBY_INSTALL/demo/simple/SimpleApp.java .
+</p>
+<p>
+   By default this application runs in embedded mode.
+   If you pass it the <span class="codefrag">derbyclient</span> argument at run time, 
+   then it will
+   create and connect to the database using the Derby Network Client JDBC
+   driver instead.
+   </p>
+<a name="N10159"></a><a name="ns_lookat_code"></a>
+<h3 class="boxed">A quick look at the code</h3>
+<p>
+   The <span class="codefrag">SimpleApp.java</span> application spends most of its time
+   creating a table, inserting data into that table, and selecting the
+   data back, demonstrating many JDBC calls as it does so.
+   This section highlights the JDBC calls that make this specifically a
+   client/server Derby application.
+   The "<a href="embedded_intro.html#em_lookat_code">Embedded Derby</a>"
+   section shows how to turn the same code into an embedded application.
+   </p>
+<a name="N10169"></a><a name="jdbc_ns_client"></a>
+<h4>Load the Client JDBC Driver</h4>
+<p>
+   When executed with the <span class="codefrag">derbyclient</span> argument,
+   the <span class="codefrag">SimpleApp</span> application
+   loads the Derby Network Client driver with this code:
+   </p>
+<p class="code-block">driver = "org.apache.derby.jdbc.ClientDriver";
+...
+Class.forName(driver).newInstance();
+</p>
+<a name="N1017D"></a><a name="url_ns_client"></a>
+<h4>Get a Network Server Connection</h4>
+<p>
+   When executed with the <span class="codefrag">derbyclient</span> argument,
+   the <span class="codefrag">SimpleApp</span> application
+   creates and connects to the <span class="codefrag">derbyDB</span> database with this code:
+   </p>
+<p class="code-block">protocol = "jdbc:derby://localhost:1527/";
+...
+conn = DriverManager.getConnection(protocol + "derbyDB;create=true", props);
+</p>
+<p>
+   That connection URL, fully constructed, looks like this:
+   </p>
+<p class="code-block">jdbc:derby://localhost:1527/derbyDB;create=true</p>
+<a name="N1019B"></a><a name="ns_client_noshutdown"></a>
+<h4>Don't shut Derby down</h4>
+<p>
+   If you look at the <span class="codefrag">SimpleApp.java</span> code you'll notice that it
+   only shuts Derby down if it's running in embedded mode.
+   When connecting <em>via</em> the Network Server, 
+   other applications might be accessing
+   the same database you are; so, don't shut down the databases or Derby.
+   </p>
+<a name="N101AC"></a><a name="compile_ns_client"></a>
+<h3 class="boxed">Compile Sample Application</h3>
+<p>
+   Compile the sample application as shown below:
+   </p>
+<p class="code-block">javac SimpleApp.java</p>
+<a name="N101BA"></a><a name="run_ns_client"></a>
+<h3 class="boxed">Run Sample Application</h3>
+<p>
+   Run the sample application like this:
+   </p>
+<p class="code-block">java SimpleApp derbyclient</p>
+<p>You should see the output shown below:</p>
+<p class="code-block">SimpleApp starting in derbyclient mode.
+Loaded the appropriate driver.
+Connected to and created database derbyDB
+Created table derbyDB
+Inserted 1956 Webster
+Inserted 1910 Union
+Updated 1956 Webster to 180 Grand
+Updated 180 Grand to 300 Lakeshore
+Verified the rows
+Dropped table derbyDB
+Closed result set and statement
+Committed transaction and closed connection
+SimpleApp finished</p>
+<p>Quick question: 
+      Where is the physical location of the <span class="codefrag">derbyDB</span> database 
+      that the sample application creates?
+   </p>
+<p>
+<em>(Answer: In the default
+   <span class="codefrag">$DERBY_INSTALL/frameworks/NetworkServer/bin</span> location.)
+   </em>
+   
+</p>
+</div>
+
+
+<a name="N101DE"></a><a name="stop_ns"></a>
+<h2 class="boxed">Stop Network Server</h2>
+<div class="section">
+<p>
+Stop the Network server by executing the
+<span class="codefrag">stopNetworkServer.bat</span> (Windows) or
+<span class="codefrag">stopNetworkServer.ksh</span> (UNIX) script, as shown below:
+</p>
+<p class="code-block">Windows:
+C:\&gt; cd %DERBY_INSTALL%\frameworks\NetworkServer\bin
+C:\Apache\db-derby-10.1.2.1-bin\frameworks\NetworkServer\bin&gt; setNetworkServerCP.bat
+C:\Apache\db-derby-10.1.2.1-bin\frameworks\NetworkServer\bin&gt; stopNetworkServer.bat
+</p>
+<p class="code-block">UNIX:
+$ cd $DERBY_INSTALL/frameworks/NetworkServer/bin
+$ . setNetworkServerCP.ksh
+$ stopNetworkServer.ksh
+</p>
+<p>The window running the NetworkServer should output a
+'<span class="codefrag">Shutdown successful</span>' message.
+</p>
+</div>
+
+
+<a name="N101FC"></a><a name="ns_next_steps"></a>
+<h2 class="boxed">Next Steps</h2>
+<div class="section">
+<a name="N10202"></a><a name="Network+Server+Options"></a>
+<h3 class="boxed">Network Server Options</h3>
+<p>
+By default, the Derby Network Server only accepts requests from the
+localhost on port 1527.
+You can modify the Network Server to:
+</p>
+<ul>
+  
+<li>Listen on a different port.</li>
+  
+<li>Accept requests from outside the localhost.</li>
+  
+<li>Run in the Java 2 Security Manager for increased security, 
+      which we strongly recommend.</li>
+
+</ul>
+<p>
+For more information about these options, and more, see the
+<a href="http://db.apache.org/derby/manuals">Derby Server and 
+Administration Guide</a>.
+</p>
+<a name="N1021F"></a><a name="Embedded+Server"></a>
+<h3 class="boxed">Embedded Server</h3>
+<p>
+Up until this point,
+this section has focused on how to start and stop
+the Network Server as an independent process.
+</p>
+<p>
+Another option, called the "embedded server",
+allows an application to load the embedded JDBC driver for its own use and
+start the Network Server to allow remote access by applications running
+in other JVMs.
+The application that does this can access the database with either the
+embedded driver or the client driver.
+</p>
+<p>
+Figure 3 depicts an application called
+<span class="codefrag">MyEmbedSrvApp</span> that loads the embedded driver and also
+starts up the Network Server.
+This allows other applications,
+such as <span class="codefrag">ij</span> and <span class="codefrag">sysinfo</span>,
+to connect to the same database <em>via</em> a client JDBC driver.
+</p>
+<p>
+
+<strong>Figure 3: Derby Embedded Server Architecture</strong>
+
+</p>
+<p>
+
+<img alt="Figure 3: Derby Embedded Server Architecture" src="embedded_server.png">
+</p>
+<p>
+While it is certainly <em>possible</em> 
+for <span class="codefrag">MyEmbedSrvApp</span> 
+to use the Derby Network Client JDBC driver, 
+it's probably better for it to use the embedded driver
+because Derby Network Client JDBC database requests will incur the
+overhead of going out through the network.
+The embedded server architecture lets
+the application that embeds Derby retain the advantages of
+embedded access while
+also enabling remote access to the same database using another tool,
+such as <span class="codefrag">ij</span> or <span class="codefrag">sysinfo</span>.
+So, you end up with the best of both worlds: embedded and client/server.
+</p>
+<p>
+You've reached the end of this Derby tutorial and should now understand
+how to use Derby in the embedded and Network Server frameworks.
+The "<a href="index.html#next">Overview</a>" section provides suggestions
+for how you might use Derby with some other products.
+</p>
+</div>
+
+
+
+</div>
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("<text>Last Published:</text> " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+        Copyright &copy;
+         2004-2005 Apache Software Foundation</div>
+<div id="feedback">
+    Send feedback about the website to:
+  <a id="feedbackto" href="mailto:derby-dev@db.apache.org?subject=Feedback%C2%A0papers/DerbyTut/ns_intro.html">derby-dev@db.apache.org</a>
+</div>
+</div>
+</body>
+</html>

Propchange: db/derby/site/trunk/build/site/papers/DerbyTut/ns_intro.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/site/trunk/build/site/papers/Intersect-design.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/Intersect-design.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/Intersect-design.html (original)
+++ db/derby/site/trunk/build/site/papers/Intersect-design.html Thu Dec  8 14:30:05 2005
@@ -79,6 +79,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/JDBCImplementation.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/JDBCImplementation.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/JDBCImplementation.html (original)
+++ db/derby/site/trunk/build/site/papers/JDBCImplementation.html Thu Dec  8 14:30:05 2005
@@ -84,6 +84,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/MiscPresentations.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/MiscPresentations.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/MiscPresentations.html (original)
+++ db/derby/site/trunk/build/site/papers/MiscPresentations.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.2', '../skin/')" id="menu_1.2Title" class="menutitle">Derby Engine</div>
 <div id="menu_1.2" class="menuitemgroup">

Modified: db/derby/site/trunk/build/site/papers/btree_package.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/btree_package.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/btree_package.html (original)
+++ db/derby/site/trunk/build/site/papers/btree_package.html Thu Dec  8 14:30:05 2005
@@ -79,6 +79,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/derby_arch.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/derby_arch.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/derby_arch.html (original)
+++ db/derby/site/trunk/build/site/papers/derby_arch.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/derby_htw.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/derby_htw.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/derby_htw.html (original)
+++ db/derby/site/trunk/build/site/papers/derby_htw.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/derby_web.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/derby_web.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/derby_web.html (original)
+++ db/derby/site/trunk/build/site/papers/derby_web.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.2', '../skin/')" id="menu_1.2Title" class="menutitle">Derby Engine</div>
 <div id="menu_1.2" class="menuitemgroup">

Modified: db/derby/site/trunk/build/site/papers/fortune_tut.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/fortune_tut.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/fortune_tut.html (original)
+++ db/derby/site/trunk/build/site/papers/fortune_tut.html Thu Dec  8 14:30:05 2005
@@ -119,6 +119,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.3.5', '../skin/')" id="menu_1.3.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.3.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.4', '../skin/')" id="menu_1.4Title" class="menutitle">Derby Engine</div>
 <div id="menu_1.4" class="menuitemgroup">

Modified: db/derby/site/trunk/build/site/papers/index.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/index.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/index.html (original)
+++ db/derby/site/trunk/build/site/papers/index.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_1.2', '../skin/')" id="menu_1.2Title" class="menutitle">Derby Engine</div>
 <div id="menu_1.2" class="menuitemgroup">
@@ -409,14 +427,17 @@
 <h2 class="boxed">Instruction</h2>
 <div class="section">
 <p>
-The information in this section was moved to the
+Check out the <a href="DerbyTut/index.html">Derby web site tutorial</a>.
+</p>
+<p>
+The rest of the information previously in this section was moved to the
 <a class="external" href="http://wiki.apache.org/db-derby/DerbyInstruction">Derby Wiki</a>
 to make it easier for anyone to add new entries.
 </p>
 </div>
 
 
-<a name="N101AB"></a><a name="Articles+and+Books"></a>
+<a name="N101B2"></a><a name="Articles+and+Books"></a>
 <h2 class="boxed">Articles and Books</h2>
 <div class="section">
 <p>
@@ -427,7 +448,7 @@
 </div>
 
 
-<a name="N101B9"></a><a name="How+to+Contribute+Papers"></a>
+<a name="N101C0"></a><a name="How+to+Contribute+Papers"></a>
 <h2 class="boxed">How to Contribute Papers</h2>
 <div class="section">
 <p>

Modified: db/derby/site/trunk/build/site/papers/logformats.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/logformats.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/logformats.html (original)
+++ db/derby/site/trunk/build/site/papers/logformats.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/optimizer.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/optimizer.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/optimizer.html (original)
+++ db/derby/site/trunk/build/site/papers/optimizer.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/pageformats.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/pageformats.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/pageformats.html (original)
+++ db/derby/site/trunk/build/site/papers/pageformats.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/recovery.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/recovery.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/recovery.html (original)
+++ db/derby/site/trunk/build/site/papers/recovery.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/papers/versionupgrade.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/papers/versionupgrade.html?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/versionupgrade.html (original)
+++ db/derby/site/trunk/build/site/papers/versionupgrade.html Thu Dec  8 14:30:05 2005
@@ -77,6 +77,24 @@
 <div class="menuitem">
 <a href="http://wiki.apache.org/db-derby/DerbyBooksAndArticles">Articles/Books</a>
 </div>
+<div onclick="SwitchMenu('menu_1.1.5', '../skin/')" id="menu_1.1.5Title" class="menutitle">Derby Tutorial</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div class="menuitem">
+<a href="../papers/DerbyTut/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/install_software.html">Step 1: Install Software</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ij_intro.html">Step 2: ij Basics</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/embedded_intro.html">Step 3: Embedded Derby</a>
+</div>
+<div class="menuitem">
+<a href="../papers/DerbyTut/ns_intro.html">Step 4: Derby Network Server</a>
+</div>
+</div>
 </div>
 <div onclick="SwitchMenu('menu_selected_1.2', '../skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Derby Engine</div>
 <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">

Modified: db/derby/site/trunk/build/site/skin/profile.css
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/skin/profile.css?rev=355248&r1=355247&r2=355248&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/skin/profile.css (original)
+++ db/derby/site/trunk/build/site/skin/profile.css Thu Dec  8 14:30:05 2005
@@ -150,6 +150,14 @@
       background-color: #f0f0f0;
       font-family: monospace;
     }
+    p.code-block {
+      margin-left: 2em;
+      padding: .5em;
+      background-color: #f0f0f0;
+      font-family: Monospace, Courier;
+      font-size: smaller;
+      white-space:pre;
+    }
     
     #footer a { color: #0F3660; }
     #footer a:visited { color: #009999; }

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded.aart
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded.aart?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded.aart (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded.aart Thu Dec  8 14:30:05 2005
@@ -0,0 +1,14 @@
++-----JVM-----+
+|+-----------+|
+||application||
+|+-----+-----+|
+|   +--+--+   |
+|   |JDBC |   |
+|   +-----+   |
+|   |DERBY|   |
+|   +--+--+   |
++------+------+
+       |   +--------+
+       \+--+database|
+           |files   |
+           +--------+

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded.aart
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_intro.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_intro.xml?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_intro.xml (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_intro.xml Thu Dec  8 14:30:05 2005
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document> 
+
+<header> <title>Step 3: Embedded Derby</title> </header> 
+
+<body> 
+
+<section id="ij_intro">
+<title>Introduction</title>
+<p>
+When an application accesses a Derby database using the Embedded Derby JDBC
+driver,
+the Derby engine does not run in a separate process, and there are no
+separate database processes to start up and shut down.
+Instead, the Derby database engine runs inside the same
+Java Virtual Machine (JVM) as the application.
+So, Derby becomes part of the application 
+just like any other jar file that the application uses.
+Figure 1 depicts this embedded architecture.
+</p>
+
+<p>
+<strong>Figure 1: Derby Embedded Architecture</strong>
+</p>
+<p>
+<img src="embedded.png" alt="Figure 1: Embedded Architecture" />
+</p>
+
+<p>
+This section shows how to compile and run a simple Java application using
+the Derby Embedded JDBC driver.
+The information presented is deliberately simple.
+For complete information, see the
+<a href="http://db.apache.org/derby/manuals/">Derby Developer's Guide</a>.
+</p>
+
+</section>
+
+<section id="embedded_setup">
+<title>Set the environment</title>
+<p>
+To set up the environment,
+follow the 
+"<a href="install_software.html#derby_configure">Configure Embedded Derby</a>"
+instructions.
+</p>
+</section>
+
+<section id="sample_app">
+<title>Sample Application</title>
+
+   <section id="copy_sample_app">
+   <title>Copy sample application</title>
+
+   <p>
+   The Derby software includes a sample application. Copy that application
+   into your current directory as shown below:
+   </p>
+
+<p class="code-block">Windows:
+c:\&gt; copy %DERBY_INSTALL%\demo\simple\SimpleApp.java .
+</p>
+
+<p class="code-block">UNIX:
+cp $DERBY_INSTALL/demo/simple/SimpleApp.java .
+</p>
+
+   <p>
+   By default this application runs in embedded mode and does the following:
+   </p>
+
+   <ul>
+       <li> Starts up the Derby engine</li>
+       <li> Creates and connects to a database</li>
+       <li> Creates a table</li>
+       <li> Inserts data</li>
+       <li> Updates data</li>
+       <li> Selects data</li>
+       <li> Drops a table</li>
+       <li> Disconnects</li>
+       <li> Shuts down Derby</li>
+   </ul>
+
+   </section>
+
+   <section id="em_lookat_code">
+   <title>A quick look at the code</title>
+
+   <p>
+   The <code>SimpleApp.java</code> application spends most of its time
+   creating a table, inserting data into that table, and selecting the
+   data back, demonstrating many JDBC calls as it does so.
+   This section highlights the JDBC calls that make this specifically an
+   embedded Derby application.
+   The "<a href="ns_intro.html#ns_lookat_code">Derby Network Server</a>"
+   section shows how the same JDBC calls turn the same code into a 
+   client/server application.
+   </p>
+
+   <section id="embedded_driver">
+   <title>Load the Embedded JDBC Driver</title>
+   
+   <p>
+   The <code>SimpleApp</code> application
+   loads the Derby Embedded JDBC driver and starts Derby up with this code:
+   </p>
+
+<p class="code-block">public String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+...
+Class.forName(driver).newInstance();
+</p>
+
+   </section>
+
+   <section id="embedded_url">
+   <title>Get an Embedded Connection</title>
+
+   <p>
+   The <code>SimpleApp</code> application
+   creates and connects to the <code>derbyDB</code> database with this code:
+   </p>
+
+<p class="code-block">public String protocol = "jdbc:derby:";
+...
+conn = DriverManager.getConnection(protocol + "derbyDB;create=true", props);
+</p>
+
+   <p>
+   That embedded connection URL, fully constructed, looks like this:
+   </p>
+
+   <p class="code-block">jdbc:derby:derbyDB;create=true</p>
+
+   </section>
+
+   <section id="shutdown">
+   <title>Shut Derby down</title>
+
+   <p>A clean shutdown performs a checkpoint and releases resources. 
+      If an embedded application doesn't shut down Derby, 
+      a checkpoint won't be performed.
+      Nothing bad will happen; it just means that the next connection 
+       will be slower because Derby will run its recovery code.
+   </p>
+      
+   <p>Code to shut down a specific database looks like this: </p>
+
+   <p class="code-block">DriverManager.getConnection("jdbc:derby:MyDbTest;shutdown=true");</p>
+
+   <p>Code to shut down all databases and the Derby engine looks like this: </p>
+
+   <p class="code-block">DriverManager.getConnection("jdbc:derby:;shutdown=true");</p>
+
+   <p>The <code>SimpleApp.java</code> code uses the second call to shut down
+    all databases and the engine.
+    You might also notice that it tests for a SQL exception.
+    A clean shutdown always throws SQL exception <code>XJ015</code>, 
+    which can be ignored.
+   </p>
+   </section>
+   </section>
+
+   <section id="compile_sample_app">
+   <title>Compile sample application</title>
+
+   <p>
+   Compile the sample application as shown below:
+   </p>
+   
+   <p class="code-block">javac SimpleApp.java</p>
+
+   </section>
+
+   <section id="run_sample_app">
+   <title>Run sample application</title>
+
+   <p>
+   Run the sample application like this:
+   </p>
+
+   <p class="code-block">java SimpleApp</p>
+
+   <p>You should see the output shown below:</p>
+
+<p class="code-block">SimpleApp starting in embedded mode.
+Loaded the appropriate driver.
+Connected to and created database derbyDB
+Created table derbyDB
+Inserted 1956 Webster
+Inserted 1910 Union
+Updated 1956 Webster to 180 Grand
+Updated 180 Grand to 300 Lakeshore
+Verified the rows
+Dropped table derbyDB
+Closed result set and statement
+Committed transaction and closed connection
+Database shut down normally
+SimpleApp finished
+</p>
+
+   <p>If instead you see an error like the one below, it means the class path
+   is not correctly set:
+   </p>
+
+<p class="code-block">java SimpleApp
+SimpleApp starting in embedded mode.
+exception thrown:
+java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
+        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
+        at java.security.AccessController.doPrivileged(Native Method)
+        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
+        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
+        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
+        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
+        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
+        at java.lang.Class.forName0(Native Method)
+        at java.lang.Class.forName(Class.java:141)
+        at SimpleApp.go(SimpleApp.java:77)
+        at SimpleApp.main(SimpleApp.java:61)
+SimpleApp finished
+</p>
+
+   <p>
+   For help resolving class path problems, see the 
+   "<a href="install_software.html#derby_configure">Configure Embedded Derby</a>"
+   and
+   "<a href="install_software.html#derby_verify">Verify Derby</a>"
+   instructions.
+   </p>
+   </section>
+
+
+</section>
+
+<section id="just_one_app">
+<title>Embedded Derby supports multiple users in one JVM</title>
+
+<p>
+Derby supports multiple connections to a given database.
+An example of an embedded application that manages concurrent users 
+is a Tomcat or Geronimo application server that embeds Derby.
+Any number of users can execute Web applications that access a database
+through that Web server.
+</p>
+
+<p>
+However, only one JVM may boot ("open") that database, so
+multiple applications running in <em>different</em> JVMs
+cannot access the same database.
+To understand this better, do the following.
+</p>
+
+<p>
+The <code>SimpleApp</code> application created a database called
+<code>derbyDB</code>. 
+In one window connect to this database with
+<code>ij</code> as shown below:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.ij
+ij version 10.1
+ij&gt; connect 'jdbc:derby:derbyDB';
+ij&gt;
+</p>
+</section>
+
+<p>
+Now, in another window try to run your <code>SimpleApp</code>
+application:
+</p>
+
+<p class="code-block">java SimpleApp
+SimpleApp starting in embedded mode.
+Loaded the appropriate driver.
+exception thrown:
+SQL Exception: Failed to start database 'derbyDB', see the next exception for details.
+SQL Exception: Another instance of Derby may have already booted the database /home/jta/databases/sample_app/derbyDB.
+SimpleApp finished
+</p>
+
+<p>
+The connection that <code>SimpleApp</code> tries to establish fails because
+another application,
+<code>ij</code>,
+is already connected to the <code>derbyDB</code> database.
+</p>
+
+<p>
+The problem is <code>ij</code> and <code>SimpleApp</code> are running in
+different JVMs
+and a given database can only be accessed from one JVM. 
+The first application to connect "wins", in this case <code>ij</code>, and
+prevents other applications from connecting.
+</p>
+<p>
+In fact, you <em>can</em> establish multiple connections to a given database from
+different JVMs.
+That's the topic of the next section, 
+"<a href="ns_intro.html">Step 4: Derby Network Server</a>".
+</p>
+
+</body>
+</document>

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_intro.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_server.aart
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_server.aart?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_server.aart (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_server.aart Thu Dec  8 14:30:05 2005
@@ -0,0 +1,24 @@
++-------JVM-------+   +---JVM---+
+| +-------------+ |   |  +--+   |
+| |MyEmbedSrvApp| |   |  |ij|   |
+| +---+-----+---+ |   |  ++-+   |
+|     |  +--+----+|   |+--+----+|
+|     |  |Derby  ||   ||Derby  ||
+|     |  |Network||   ||Network||
+|     |  |Client || +-++Client ||
+|     |  +--+----+| | |+-------+|
+|     | +---+---+ | | +---------+
+|     | |Derby  +-+-+
+|     | |Network| |
+|     | |Server +-+-+ +---JVM----+
+|     | +-+-----+ + | |+-------+ |
+|    ++---++      | | ||sysinfo| |
+|    |JDBC |      | | |+---+---+ |
+|    +-----+      | | | +--+----+|
+|    |DERBY|      | | | |Derby  ||
+|    +--+--+      | +-+-+Network||
++-------+---------+   | |Client ||
+        |  +--------+ | +-------+|
+        \+-+database| +----------+
+           |files   |
+           +--------+

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/embedded_server.aart
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/ij_intro.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/ij_intro.xml?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/ij_intro.xml (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/ij_intro.xml Thu Dec  8 14:30:05 2005
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document> 
+
+<header> <title>Step 2: ij Basics</title> </header> 
+
+<body> 
+
+<section id="ij_intro">
+<title>Introduction</title>
+<p>
+<code>ij</code> is an interactive SQL scripting tool that comes with Derby. 
+It can be used with the Derby Embedded JDBC driver 
+or with a client JDBC driver, such as the Derby Network Client.
+</p>
+<p>
+This section uses the Derby Embedded JDBC driver to introduce a few 
+<code>ij</code> features.
+The information presented here is minimal, just enough to get started.
+For a more complete introduction, see the
+<a href="http://db.apache.org/derby/docs/dev/tools/ctoolsij32837.html">Getting
+started with ij</a> section
+in the <a href="http://db.apache.org/derby/manuals/">Tools 
+and Utilities Guide</a>.
+</p>
+</section>
+
+<section id="ij_setup">
+<title>Set the environment</title>
+<p>
+To set up the environment,
+follow the 
+"<a href="install_software.html#derby_configure">Configure Embedded Derby</a>"
+instructions.
+</p>
+</section>
+
+<section id="ij_start">
+<title>Start up ij</title>
+
+<p>Start up <code>ij</code> with this command:</p>
+
+<p class="code-block">java org.apache.derby.tools.ij</p>
+
+<p>You should see the output shown below:</p>
+
+<p class="code-block">ij version 10.1
+ij&gt;
+</p>
+
+<p>
+The error below means the class path isn't set correctly:
+</p>
+<p class="code-block">java org.apache.derby.tools.ij
+Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/derby/tools/ij
+</p>
+
+<p>
+For help resolving class path problems, see the 
+"<a href="install_software.html#derby_configure">Configure Embedded Derby</a>"
+and
+"<a href="install_software.html#derby_verify">Verify Derby</a>"
+instructions.
+</p>
+
+
+</section>
+
+<section id="ij_create">
+<title>Create a database</title>
+
+<p>
+To create a database,
+specify the <code>create=true</code> attribute
+in the connection URL. 
+For example, the command below creates a new database called
+<code>MyDbTest</code>:
+</p>
+
+<p class="code-block">ij&gt; connect 'jdbc:derby:MyDbTest;create=true';</p>
+
+<p>
+Now quit out of <code>ij</code>:
+</p>
+
+<p class="code-block">ij&gt; exit; </p>
+
+<p>
+List the contents of your directory with
+<code>ls</code> (UNIX) or
+<code>dir</code> (Windows).
+On UNIX you'll see output like this:
+</p>
+
+<p class="code-block">$ ls
+MyDbTest  derby.log
+</p>
+
+<p>
+The <code>MyDbTest</code> directory contains the files that make up 
+the database you just created.
+The <code>derby.log</code> file is an error log, which is helpful
+whenever things don't work as expected.
+</p>
+
+</section>
+
+<section id="ij_connect">
+<title>Connect to a database</title>
+
+<p>
+Start up <code>ij</code> again and 
+<a href="http://db.apache.org/derby/docs/dev/tools/rtoolsijcomref22318.html">connect</a> to the database you just created:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.ij
+ij&gt; connect 'jdbc:derby:MyDbTest';
+</p>
+
+<p>
+We'll take a quick look at the
+protocol ("<code>jdbc:derby:</code>") and
+database ("<code>MyDbTest</code>") in this connection URL.
+</p>
+
+<section>
+<title>Protocol</title>
+<p>
+Internally, <code>ij</code> determines by default which driver to load
+from the protocol ("<code>jdbc:derby:</code>").
+In this case, it knows to load the embedded JDBC driver.
+We could also have specified the protocol with a property as shown below:
+</p>
+
+<p class="code-block">java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij
+ij&gt; connect 'MyDbTest';
+</p>
+
+<p>
+For more information about <code>ij</code> startup properties see
+<a href="http://db.apache.org/derby/docs/dev/tools/ttoolsij30600.html">Starting
+ij using properties</a> in the
+<a href="http://db.apache.org/derby/docs/dev/tools/ttoolsij98878.html">Tools 
+and Utilities Guide</a>.
+</p>
+</section>
+
+<section>
+<title>Database</title>
+<p>
+Connecting to the <code>MyDbTest</code> database in the connection URL
+above works
+because the <code>MyDbTest</code> database directory is
+in the current working directory;
+<em>i.e.</em>,
+the directory where you started up <code>ij</code>.
+</p>
+<p>
+Let's say that your current directory location is 
+<code>/home/bill/databases</code>
+and that you decide to change your directory to a different place entirely.
+You can connect to the <code>MyDbTest</code> database 
+by specifying the complete directory path,
+like this:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.ij
+ij&gt; connect 'jdbc:derby:/home/bill/databases/MyDbTest';
+</p>
+
+<p>
+You could also specify the Derby system home for the database like this:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.ij -Dderby.system.home=/home/bill/databases
+ij&gt; connect 'jdbc:derby:MyDbTest';
+</p>
+
+<p>
+The <em>Developer's Guide</em> provides information
+about where Derby looks for databases:
+</p>
+
+<ul>
+   <li><a href="http://db.apache.org/derby/docs/dev/devguide/cdevdvlp34964.html">Connecting to databases</a></li>
+   <li> <a href="http://db.apache.org/derby/docs/dev/devguide/cdevdvlp13018.html">Defining the system directory</a></li>
+</ul>
+
+</section>
+
+</section>
+
+<section id="ij_sql">
+<title>Execute SQL statements</title>
+
+<p>
+Once you connect to a database, you can execute SQL statements.
+<code>ij</code> expects each statement to be terminated
+with a semicolon (;); for example:
+</p>
+
+<p class="code-block">ij&gt; create table derbyDB(num int, addr varchar(40));
+ij&gt; insert into derbyDB values (1956,'Webster St.');
+ij&gt; insert into derbyDB values (1910,'Union St.');
+ij&gt; update derbyDB set num=180, addr='Grand Ave.' where num=1956;
+ij&gt; select * from derbyDb;
+</p>
+
+
+</section>
+
+<section id="ij_disconnect">
+<title>Disconnect from a database</title>
+<p>
+The <a href="http://db.apache.org/derby/docs/dev/tools/rtoolsijcomref20382.html">disconnect</a> 
+command disconnects from the current database:
+</p>
+<p class="code-block">ij&gt; disconnect;</p>
+</section>
+
+<section id="ij_exit">
+<title>Exit</title>
+<p>
+The <a href="http://db.apache.org/derby/docs/dev/tools/rtoolsijcomref33358.html">exit</a>
+command quits out of <code>ij</code> and, in embedded mode,
+shuts down the Derby database:
+</p>
+<p class="code-block">ij&gt; exit;</p>
+</section>
+
+<section>
+<title>Run SQL Scripts</title>
+
+<p>
+You can execute SQL scripts in <code>ij</code> as shown below:
+</p>
+
+<p class="code-block">ij&gt; run 'my_file.sql';</p>
+
+<p>
+You can also run SQL scripts from the command line:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.ij my_file.sql</p>
+
+<p>
+The <a href="http://db.apache.org/derby/docs/dev/tools/ttoolsij98878.html">Tools and Utilities Guide</a>
+provides more information about running SQL scripts from <code>ij</code>.
+</p>
+
+<p>
+After completing these <code>ij</code> steps, you're
+ready to move to "<a href="embedded_intro.html">Step 3: Embedded Derby</a>".
+</p>
+
+</section>
+
+</body>
+</document>

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/ij_intro.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/index.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/index.xml?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/index.xml (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/index.xml Thu Dec  8 14:30:05 2005
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document> 
+
+<header> <title>Apache Derby Tutorial</title> </header> 
+
+<body> 
+
+<section>
+<title>Overview</title>
+<p>
+<a href="http://db.apache.org/derby">Apache Derby</a>,
+an <a href="http://db.apache.org">Apache DB subproject</a>,
+is a relational database implemented in Java.
+Its footprint is so small you can easily embed it in any Java-based solution.
+In addition to its embedded framework,
+Derby supports a more familiar client/server framework with the
+Derby Network Server.
+This tutorial introduces Derby's basic features and
+walks you through using both frameworks;
+first the embedded framework using the Derby Embedded JDBC driver, 
+then the Network Server framework using the
+Derby Network Client JDBC driver.
+</p>
+</section>
+
+<section>
+<title>Intended Audience</title>
+
+<p>
+This tutorial is intended for new Derby users who have 
+had at least light exposure to SQL, Java, and JDBC.
+</p>
+</section>
+
+<section>
+<title>Tutorial Topics</title>
+
+<p>
+This tutorial is organized into the sections below:
+</p>
+
+<ol>
+   <li> <a href="install_software.html">Install Software</a> shows how to:
+         <ul>
+           <li> Install the Apache Derby software. </li>
+           <li> Configure your environment to use the 
+                Derby Embedded JDBC driver. </li>
+           <li> Verify your installation with the <code>sysinfo</code> tool.</li>
+         </ul>
+   </li>
+   <li> <a href="ij_intro.html">ij Basics</a> shows how to
+         use the <code>ij</code> tool with the embedded Derby JDBC
+         driver to create a database and execute SQL queries.
+   </li>
+
+   <li> <a href="embedded_intro.html">Embedded Derby</a> shows how to
+        compile and run a simple Java application that uses the
+        Derby Embedded JDBC driver.
+   </li>
+   <li> <a href="ns_intro.html">Derby Network Server</a> show how to:
+        <ul>
+             <li> Start the Derby Network Server.</li>
+             <li> Configure your environment to use the
+                  Derby Network Client JDBC driver.</li>
+             <li> Compile and run a simple Java application that uses the
+                   network server.
+             </li>
+        </ul>
+   </li>
+</ol>
+
+</section>
+
+<section id="next">
+<title>Next Steps</title>
+
+<p>
+After completing the four steps in this tutorial, 
+you'll understand the basics of how to
+use Derby in the embedded and Network Server frameworks.
+</p>
+
+<section>
+<title>More Information</title>
+
+<p>
+More information about Derby is on the
+<a href="http://db.apache.org/derby">Derby web site</a>
+and on the
+<a href="http://wiki.apache.org/db-derby/">Derby Wiki</a>.
+Please post any problems or questions to the
+<a href="http://db.apache.org/derby/derby_mail.html">derby-user@db.apache.org</a>
+mail list.
+</p>
+
+</section>
+
+<section>
+<title>Using Derby with other Products</title>
+<p>
+Below is a partial list of resources on the Derby web site that show how 
+to use Derby with another product:
+</p>
+
+<ul>
+   <li> <a href="http://db.apache.org/derby/integrate/plugin_howto.html">Eclipse</a> 
+   </li>
+   <li><a href="http://db.apache.org/derby/integrate/db_torque.html">Torque</a>
+   </li>
+   <li><a href="http://db.apache.org/derby/papers/fortune_tut.html">Tomcat 5.0</a>
+   </li>
+   <li><a href="http://db.apache.org/derby/integrate/DerbyTomcat5512JPetStor.html">Tomcat 5.5</a>
+   </li>
+   <li><a href="http://db.apache.org/derby/integrate/JPetStoreGeronimo.html">Geronimo</a>
+   </li>
+   <li><a href="http://db.apache.org/derby/integrate/JPetStoreWebSphere.html">WebSphere</a>
+   </li>
+</ul>
+
+<p>
+More products that work with Derby are summarized
+on the Derby web site 
+<a href="http://db.apache.org/derby/integrate/misc.html">Integration
+Topics: Summary</a> page and on the 
+<a href="http://wiki.apache.org/db-derby/UsesOfDerby">UsesOfDerby</a> Wiki
+page.
+</p>
+</section>
+
+</section>
+
+<p><em>Last updated: December 8, 2005</em></p>
+</body>
+</document>

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/index.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/install_software.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/install_software.xml?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/install_software.xml (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/install_software.xml Thu Dec  8 14:30:05 2005
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document> 
+
+<header> <title>Step 1: Install Software</title> </header> 
+
+<body> 
+
+<section>
+<title>Introduction</title>
+
+<p>
+This tutorial
+requires the Java Development Kit (JDK)
+and the Apache Derby software.
+</p>
+
+<p>
+First, this section describes which JDK release is required, 
+asks you to install it if you haven't already,
+then shows you how to configure and verify your installation.
+</p>
+
+<p>
+Next, it shows you how to install the Apache Derby software,
+configure your environment to use the Derby Embedded JDBC driver,
+and verify your installation with the Derby <code>sysinfo</code> tool.
+</p>
+</section>
+
+<section id="jdk">
+<title>Java Development Kit (JDK)</title>
+
+<p>Derby requires Java 2 Standard Edition (J2SE) 1.3 or higher
+(this tutorial was developed using JDK 1.4.2).
+Only the Java Runtime Environment (JRE) is required to run Derby,
+but this tutorial compiles a Java application, so it requires
+the Java Development Kit (JDK).
+</p>
+<p>
+If you already have a JDK installed, 
+<a href="#jdk_verify">verify</a> you are configured to use it,
+then proceed
+to the <a href="#derby">Apache Derby</a> installation section.
+</p>
+
+<section id="jdk_install">
+<title>Install JDK</title>
+<p>
+If you have not already installed a JDK,
+download and install it now. 
+No specific vendor implementation is required;
+the only requirement is that it be certified for J2SE 1.3 or higher.
+Java's reference implementation is at
+<a href="http://java.sun.com/j2se/">http://java.sun.com/j2se/</a>.
+After installing the JDK of your choice, proceed to the next section.
+</p>
+</section>
+
+<section id="jdk_configure">
+<title>Configure JDK</title>
+
+<p>
+Set the <code>JAVA_HOME</code> environment variable to the root location of
+the JDK installation directory.
+The examples below use
+<code>C:\jdk1.4</code> for Windows and 
+<code>/opt/jdk1.4</code> for UNIX, but be sure to use the actual
+location on your system.
+</p>
+
+<p class="code-block">Windows:
+C:\&gt; set JAVA_HOME=C:\jdk1.4
+</p>
+
+<p class="code-block">UNIX Korn Shell:
+$ export JAVA_HOME=/opt/jdk1.4
+</p>
+
+<p>
+Next set the <code>PATH</code> environment variable to include the JDK
+<code>bin</code> directory.
+The <code>PATH</code> variable tells the operating system where to find the
+<code>java</code> interpreter and the <code>javac</code> compiler.
+</p>
+
+<p class="code-block">Windows:
+C:\&gt; set PATH=%PATH%;%JAVA_HOME%\bin
+</p>
+
+<p class="code-block">UNIX Korn Shell:
+$ export PATH=$JAVA_HOME/bin:$PATH
+</p>
+
+
+</section>
+
+<section id="jdk_verify">
+<title>Verify JDK</title>
+<p>
+Use the <code>java -version</code> command, as shown below,
+to verify the installed release:
+</p>
+
+<p class="code-block">java -version
+java version "1.4.2_04"
+Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
+Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
+</p>
+
+<p>
+The output you see may be different from what is shown above because
+the <code>java -version</code> command outputs vendor-specific information;
+however, if you don't see what looks like valid version information, then 
+<strong>STOP!</strong>
+And don't proceed until you resolve that problem.
+</p>
+
+</section>
+
+</section>
+
+<section id="derby">
+<title>Apache Derby</title>
+
+    <section id="derby_download">
+    <title>Download Derby</title>
+<p>
+Download the binary Apache Derby distribution from the Derby web site at 
+<a href="http://db.apache.org/derby/derby_downloads.html">http://db.apache.org/derby/derby_downloads.html</a>.
+These tutorial instructions use version 10.1.2.1 and 
+assume you downloaded one of the binary distribution files 
+listed in the table below:
+</p>
+
+<table>
+     <tr><th>Operating System</th><th>Download File</th></tr>
+     <tr><td>Windows</td><td>db-derby-10.1.2.1-bin.zip</td></tr>
+     <tr><td>UNIX, Linux, and Mac</td><td>db-derby-10.1.2.1-bin.tar.gz</td></tr>
+</table>
+
+<p>If a more recent release is available, download that,
+   then substitute that version number 
+for <code>10.1.2.1</code> in the following instructions.
+   </p>
+   </section>
+
+    <section id="derby_install">
+    <title>Install Derby</title>
+
+    <p>
+    Choose the directory into which you want to install the Derby software.
+    You must have write permissions to this directory.
+    The sample instructions below use <code>C:\Apache</code> for Windows and
+    <code>/opt/Apache</code> for UNIX; be sure to use your actual location.
+    Copy the software distribution to the location you choose, then
+    extract it as shown below.
+    </p>
+
+<p class="code-block">Windows (use your extraction tool -- these instructions show mks unzip):
+mkdir C:\Apache
+copy db-derby-10.1.2.1-bin.zip C:\Apache
+cd C:\Apache
+unzip db-derby-10.1.2.1-bin.zip
+</p>
+
+<p class="code-block">UNIX:
+mkdir /opt/Apache
+cp db-derby-10.1.2.1-bin.tar.gz /opt/Apache
+cd /opt/Apache
+tar xzvf db-derby-10.1.2.1-bin.tar.gz
+</p>
+
+   <p>In both cases, the software will now be extracted into a subdirectory
+    named <code>db-derby-10.1.2.1-bin</code>. 
+   </p>
+
+</section>
+<section id="set_derby_install">
+<title>Set DERBY_INSTALL</title>
+
+<p>
+Set the <code>DERBY_INSTALL</code> variable to the location where you
+installed Derby.
+Examples are shown below, but be sure to use the actual location on 
+your system:
+</p>
+
+<p class="code-block">Windows:
+C:\&gt; set DERBY_INSTALL=C:\Apache\db-derby-10.1.2.1-bin
+</p>
+
+<p class="code-block">UNIX Korn Shell:
+$ export DERBY_INSTALL=/opt/Apache/db-derby-10.1.2.1-bin
+</p>
+
+</section>
+
+    <section id="derby_configure">
+    <title>Configure Embedded Derby</title>
+
+   <p>To use Derby in its embedded mode
+      set your <code>CLASSPATH</code> to include the jar files listed below:</p>
+  
+   <ul>
+     <li> <code>derby.jar</code>: contains the Derby engine and the
+              Derby Embedded JDBC driver</li>
+     <li> <code>derbytools.jar</code>:
+           optional, provides the <code>ij</code> tool that is used
+          by a couple sections in this tutorial</li>
+</ul>
+
+<p>
+   You can set your <code>CLASSPATH</code> explicitly with the command
+   shown below:
+</p>
+<p class="code-block">Windows:
+C:\&gt; set CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbytools.jar;.
+</p>
+
+<p class="code-block">UNIX:
+$ export CLASSPATH=$DERBY_INSTALL/lib/derby.jar:$DERBY_INSTALL/lib/derbytools.jar:.
+</p>
+<p>
+Notice that multiple entries in the class path are separated by a
+semicolon (;) on Windows and a colon (:) on UNIX.
+</p>
+<p>
+   The Derby software provides another way to set <code>CLASSPATH</code>,
+   using shell scripts (UNIX) and batch files (Windows).
+   This tutorial shows how to set
+   <code>CLASSPATH</code> explicitly 
+   and also how to use the Derby scripts to set it.
+</p>
+<p>
+   Change directory now into the
+   <code>DERBY_INSTALL/frameworks/embedded/bin</code> directory.
+    The <code>setEmbeddedCP.bat</code> (Windows) 
+    and <code>setEmbeddedCP.ksh</code>
+     (UNIX) scripts use the <code>DERBY_INSTALL</code> variable to set the 
+     <code>CLASSPATH</code>  for Derby embedded usage. 
+     You can edit the script itself to set 
+     <code>DERBY_INSTALL</code>, or you can let the script get 
+     <code>DERBY_INSTALL</code> from your environment. 
+     Since you already set <code>DERBY_INSTALL</code> in the 
+     "<a href="#set_derby_install">Set DERBY_INSTALL</a>" section above, 
+     you don't need to edit the script, 
+     so go ahead and execute it as shown below:
+   </p>
+
+<p class="code-block">Windows:
+C:\&gt; cd %DERBY_INSTALL%\frameworks\embedded\bin
+C:\Apache\db-derby-10.1.2.1-bin\frameworks\embedded\bin&gt; setEmbeddedCP.bat
+</p>
+
+<p class="code-block">UNIX:
+$ cd $DERBY_INSTALL/frameworks/embedded/bin
+$ . setEmbeddedCP.ksh
+</p>
+
+    </section>
+
+    <section id="derby_verify">
+    <title>Verify Derby</title>
+
+<p>Run the <code>sysinfo</code> command, as shown below, to output Derby
+system information:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.sysinfo</p>
+
+<p>Successful output will look something like this:</p>
+
+<p class="code-block">------------------ Java Information ------------------
+Java Version:    1.4.2_06
+Java Vendor:     Sun Microsystems Inc.
+Java home:       /opt/jdk1.4
+Java classpath:  /opt/Apache/db-derby-10.1.2.1-bin/lib/derby.jar:/opt/Apache/db-derby-10.1.2.1-bin/lib/derbytools.jar:
+OS name:         Linux
+OS architecture: i386
+OS version:      2.6.10-1.760_FC3
+Java user name:  jta
+Java user home:  /home/jta
+Java user dir:   /opt/Apache/db-derby-10.1.2.1-bin/frameworks/embedded/bin
+java.specification.name: Java Platform API Specification
+java.specification.version: 1.4
+--------- Derby Information --------
+JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
+[/opt/Apache/db-derby-10.1.2.1-bin/lib/derby.jar] 10.1.2.1 - (330608)
+[/opt/Apache/db-derby-10.1.2.1-bin/lib/derbytools.jar] 10.1.2.1 - (330608)
+------------------------------------------------------
+----------------- Locale Information -----------------
+------------------------------------------------------
+</p>
+
+<p>
+The output on your system will probably be somewhat different 
+than the output shown above, 
+but it should reflect the correct location 
+of jar files on your machine and there shouldn't be any errors. 
+If you see an error like the one below, 
+it means your class path is not correctly set:
+</p>
+
+<p class="code-block">$ java org.apache.derby.tools.sysinfo
+Exception in thread "main" java.lang.NoClassDefFoundError: 
+     org/apache/derby/tools/sysinfo
+</p>
+
+<p>
+Echo your <code>CLASSPATH</code>, as shown below,
+then double check each entry in your class path to verify that the jar file 
+is where you expect it:
+</p>
+<p class="code-block">Windows:
+C:\&gt; echo %CLASSPATH% 
+C:\Apache\DB-DER~1.1-B\lib\derby.jar;C:\Apache\DB-DER~1.1-B\lib\derbytools.jar;
+</p>
+
+<p class="code-block">UNIX:
+$ echo $CLASSPATH
+/opt/Apache/db-derby-10.1.2.1-bin/lib/derby.jar:/opt/Apache/db-derby-10.1.2.1-bin/lib/derbytools.jar:
+</p>
+
+<p>
+If <code>sysinfo</code> outputs valid information, you're
+ready to move to "<a href="ij_intro.html">Step 2: ij Basics</a>".
+</p>
+    </section>
+
+
+</section>
+
+</body>
+</document>

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/install_software.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/network_server.aart
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/network_server.aart?rev=355248&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/network_server.aart (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/network_server.aart Thu Dec  8 14:30:05 2005
@@ -0,0 +1,28 @@
++----JVM----+ +---JVM---+
+|+---------+| |  +---+  |
+||SimpleApp|| |  | ij|  |
+|+----+----+| |  +-+-+  |
+|     |     | |    |    |
+|+----+----+| |+---+---+|
+||Derby    || ||Derby  ||
+||Network  || ||Network||
+||Client   || ||Client ||
+|+--------++| |++------+|
++---------+-+ +-+-------+
+          |     | 
+        +-+-JVM-+-+
+        |++-----++|
+        ||Derby  ||
+        ||Network||
+        ||Server ||
+        |+---+---+|
+        | +--+--+ |
+        | |JDBC | |
+        | +-----+ |
+        | |DERBY| |
+        | +--+--+ |
+        +----+----+
+             |   +--------+
+             \+--+database|
+                 |files   |
+                 +--------+

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/papers/DerbyTut/network_server.aart
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message