db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r384951 - in /db/derby/site/trunk: build/site/ build/site/integrate/ build/site/integrate/plugin_help/ build/site/papers/ src/documentation/content/xdocs/ src/documentation/content/xdocs/integrate/
Date Fri, 10 Mar 2006 23:21:32 GMT
Author: jta
Date: Fri Mar 10 15:21:26 2006
New Revision: 384951

URL: http://svn.apache.org/viewcvs?rev=384951&view=rev
Log:
Added a "Using DdlUtils to Migrate Databases to Derby" paper to the integration
section of the web site. Also added it to the menu, thus modifying all pages
on that tab.

Added:
    db/derby/site/trunk/build/site/integrate/db_ddlutils.html   (with props)
    db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml   (with props)
Modified:
    db/derby/site/trunk/build/site/derby_proposal.html
    db/derby/site/trunk/build/site/integrate/DerbyTomcat5512JPetStor.html
    db/derby/site/trunk/build/site/integrate/JPOX_Derby.html
    db/derby/site/trunk/build/site/integrate/JPetStoreGeronimo.html
    db/derby/site/trunk/build/site/integrate/JPetStoreWebSphere.html
    db/derby/site/trunk/build/site/integrate/Readme.html
    db/derby/site/trunk/build/site/integrate/db_torque.html
    db/derby/site/trunk/build/site/integrate/derby_plugin.html
    db/derby/site/trunk/build/site/integrate/func_spec_plugins.html
    db/derby/site/trunk/build/site/integrate/index.html
    db/derby/site/trunk/build/site/integrate/misc.html
    db/derby/site/trunk/build/site/integrate/plugin_help/derby_app.html
    db/derby/site/trunk/build/site/integrate/plugin_help/ij.html
    db/derby/site/trunk/build/site/integrate/plugin_help/ij2.html
    db/derby/site/trunk/build/site/integrate/plugin_help/ij_toc.html
    db/derby/site/trunk/build/site/integrate/plugin_help/java_project.html
    db/derby/site/trunk/build/site/integrate/plugin_help/nature.html
    db/derby/site/trunk/build/site/integrate/plugin_help/nature_toc.html
    db/derby/site/trunk/build/site/integrate/plugin_help/properties.html
    db/derby/site/trunk/build/site/integrate/plugin_help/remove_nature.html
    db/derby/site/trunk/build/site/integrate/plugin_help/resources.html
    db/derby/site/trunk/build/site/integrate/plugin_help/server_toc.html
    db/derby/site/trunk/build/site/integrate/plugin_help/start_server.html
    db/derby/site/trunk/build/site/integrate/plugin_help/start_toc.html
    db/derby/site/trunk/build/site/integrate/plugin_help/stop_server.html
    db/derby/site/trunk/build/site/integrate/plugin_help/sysinfo.html
    db/derby/site/trunk/build/site/integrate/plugin_howto.html
    db/derby/site/trunk/build/site/integrate/plugin_slides.html
    db/derby/site/trunk/build/site/linkmap.html
    db/derby/site/trunk/build/site/papers/fortune_tut.html
    db/derby/site/trunk/src/documentation/content/xdocs/integrate/index.xml
    db/derby/site/trunk/src/documentation/content/xdocs/site.xml

Modified: db/derby/site/trunk/build/site/derby_proposal.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/derby_proposal.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/derby_proposal.html (original)
+++ db/derby/site/trunk/build/site/derby_proposal.html Fri Mar 10 15:21:26 2006
@@ -216,6 +216,9 @@
 <a href="binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/DerbyTomcat5512JPetStor.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/DerbyTomcat5512JPetStor.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/DerbyTomcat5512JPetStor.html (original)
+++ db/derby/site/trunk/build/site/integrate/DerbyTomcat5512JPetStor.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/JPOX_Derby.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/JPOX_Derby.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/JPOX_Derby.html (original)
+++ db/derby/site/trunk/build/site/integrate/JPOX_Derby.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/JPetStoreGeronimo.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/JPetStoreGeronimo.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/JPetStoreGeronimo.html (original)
+++ db/derby/site/trunk/build/site/integrate/JPetStoreGeronimo.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/JPetStoreWebSphere.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/JPetStoreWebSphere.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/JPetStoreWebSphere.html (original)
+++ db/derby/site/trunk/build/site/integrate/JPetStoreWebSphere.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/Readme.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/Readme.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/Readme.html (original)
+++ db/derby/site/trunk/build/site/integrate/Readme.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Added: db/derby/site/trunk/build/site/integrate/db_ddlutils.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/db_ddlutils.html?rev=384951&view=auto
==============================================================================
--- db/derby/site/trunk/build/site/integrate/db_ddlutils.html (added)
+++ db/derby/site/trunk/build/site/integrate/db_ddlutils.html Fri Mar 10 15:21:26 2006
@@ -0,0 +1,756 @@
+<!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>Using DdlUtils to Migrate Databases to Derby</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/derby"><img class="logoImage" alt="Apache Derby" src="../images/derby-logo-web.png" title="Derby is a zero-admin Java RDBMS"></a>
+</div>
+<div class="projectlogoA1">
+<a href="http://db.apache.org"><img class="logoImage" alt="Apache DB Project" src="../images/db-logo-white.png" title="Apache DB creates and maintains database solutions."></a>
+</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>
+<a class="base-not-selected" href="../papers/index.html">Papers</a>
+</li>
+<li class="current">
+<a class="base-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');">Integration</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="../integrate/index.html">Index</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/db-derby/UsesOfDerby">UsesOfDerby</a>
+</div>
+<div class="menuitem">
+<a href="../binaries/HOWTO_CJDBC_Derby_v0.2.pdf">C-JDBC (PDF)</a>
+</div>
+<div class="menuitem">
+<a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">DdlUtils</div>
+</div>
+<div class="menuitem">
+<a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
+</div>
+<div class="menuitem">
+<a href="../binaries/UsingDotsDerbySystemTest.pdf">DOTS System</a>
+</div>
+<div class="menuitem">
+<a href="../binaries/DerbyCodeCoverageUsingEmma.pdf">EMMA</a>
+</div>
+<div class="menuitem">
+<a href="../binaries/DerbyAndRedHatAppServer.pdf">JOnAS (PDF)</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/JPOX_Derby.html">JPOX JDO</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/JPetStoreGeronimo.html">Geronimo Demo</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/DerbyTomcat5512JPetStor.html">Tomcat Demo</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/db_torque.html">Torque</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/JPetStoreWebSphere.html">WebSphere Demo</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.2', '../skin/')" id="menu_1.2Title" class="menutitle">Eclipse Plug-ins</div>
+<div id="menu_1.2" class="menuitemgroup">
+<div class="menuitem">
+<a href="../integrate/derby_plugin.html">10.1 Core</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/func_spec_plugins.html">1.0 UI Functional Spec</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_howto.html">10.1 Core and 1.1 UI</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/Readme.html">Building 1.1 UI</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_slides.html">Derby Plug-ins Slides and Lab</a>
+</div>
+<div onclick="SwitchMenu('menu_1.2.6', '../skin/')" id="menu_1.2.6Title" class="menutitle">10.1 Core and 1.1 UI Documentation</div>
+<div id="menu_1.2.6" class="menuitemgroup">
+<div class="menuitem">
+<a href="../integrate/plugin_help/start_toc.html">Getting Started</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/java_project.html">Creating an Eclipse Project</a>
+</div>
+<div onclick="SwitchMenu('menu_1.2.6.3', '../skin/')" id="menu_1.2.6.3Title" class="menutitle">Derby Nature</div>
+<div id="menu_1.2.6.3" class="menuitemgroup">
+<div class="menuitem">
+<a href="../integrate/plugin_help/nature_toc.html">Adding or Removing</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/nature.html">Adding the Derby Nature</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/remove_nature.html">Removing the Derby Nature</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.2.6.4', '../skin/')" id="menu_1.2.6.4Title" class="menutitle">Network Server</div>
+<div id="menu_1.2.6.4" class="menuitemgroup">
+<div class="menuitem">
+<a href="../integrate/plugin_help/server_toc.html">Starting and Stopping</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/start_server.html">Starting the Server</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/stop_server.html">Stopping the Server</a>
+</div>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/properties.html">Derby Properties</a>
+</div>
+<div onclick="SwitchMenu('menu_1.2.6.6', '../skin/')" id="menu_1.2.6.6Title" class="menutitle">ij</div>
+<div id="menu_1.2.6.6" class="menuitemgroup">
+<div class="menuitem">
+<a href="../integrate/plugin_help/ij_toc.html">Using ij</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/ij.html">SQL commands</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/ij2.html">SQL scripts</a>
+</div>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/derby_app.html">Building a Java App</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/sysinfo.html">Running sysinfo</a>
+</div>
+<div class="menuitem">
+<a href="../integrate/plugin_help/resources.html">Derby Manuals</a>
+</div>
+</div>
+</div>
+<div class="searchbox">
+<hr>
+<form action="http://www.google.com/search" method="get">
+<input value="db.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="18" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
+                  <input attr="value" name="Search" value="Search" type="submit">
+</form>
+</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>Using DdlUtils to Migrate Databases to Derby</h1>
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#Overview">Overview</a>
+<ul class="minitoc">
+<li>
+<a href="#Target+Audience">Target Audience</a>
+</li>
+<li>
+<a href="#Prerequisites">Prerequisites</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#Step+1%3A+Setup+a+working+directory">Step 1: Setup a working directory</a>
+</li>
+<li>
+<a href="#Step+2%3A+Build+and+Install+DdlUtils">Step 2: Build and Install DdlUtils</a>
+</li>
+<li>
+<a href="#Step+3%3A+Create+a+sample+database%3A+Books1">Step 3: Create a sample database: Books1 </a>
+</li>
+<li>
+<a href="#Step+4%3A+Books1+--+Export+Schema+and+Data">Step 4: Books1 -- Export Schema and Data </a>
+<ul class="minitoc">
+<li>
+<a href="#Create+an+Ant+build.xml+file+with+an+export+target">Create an Ant build.xml file with an export target</a>
+</li>
+<li>
+<a href="#Execute+the+Ant+task">Execute the Ant task</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#Step+5%3A+Books2+--+Create+Database+and+Import+Schema+and+Data">Step 5: Books2 -- Create Database and Import Schema and Data</a>
+<ul class="minitoc">
+<li>
+<a href="#Copy+and+modify+the+db-schema.xml+file">Copy and modify the db-schema.xml file</a>
+</li>
+<li>
+<a href="#Add+an+import+target+to+the+build.xml">Add an import target to the build.xml</a>
+</li>
+<li>
+<a href="#Execute+the+Ant+task-N101F4">Execute the Ant task</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#Step+6%3A+Verify+Migration">Step 6: Verify Migration</a>
+</li>
+<li>
+<a href="#Questions%3F">Questions?</a>
+</li>
+</ul>
+</div> 
+
+
+<a name="N1000C"></a><a name="Overview"></a>
+<h2 class="boxed">Overview</h2>
+<div class="section">
+<p>
+
+<a href="http://db.apache.org/ddlutils">DdlUtils</a>, an Apache DB subproject,
+provides utilities for creating and working with Database Definition (DDL) files
+and for exporting and importing data in XML format
+<em>via</em> Ant tasks or programmatically in Java.
+</p>
+<p>
+Among other uses, DdlUtils makes it easier to migrate 
+from one database vendor to another.
+This paper provides a simple example for using DdlUtils to migrate a database 
+to Derby using the
+<a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils Ant tasks</a>.
+</p>
+<p>
+Now, this example features Derby as both the source and target database
+because Derby is easily available and is what the author knows.
+But it's important to realize that there's an even easier way to
+migrate a Derby database from one machine to another:
+all you need to do is copy the Derby database files. 
+You don't need to export/import the schema and data,
+not even for machines with different architectures,
+because the files that make up a Derby database are platform-independent.
+So, substitute the Derby source database in this example
+with the vendor of your choice and you'll get an idea of 
+how DdlUtils can make it easier to migrate any database to Derby.
+</p>
+<a name="N10026"></a><a name="Target+Audience"></a>
+<h3 class="boxed">Target Audience</h3>
+<p>DdlUtils doesn't have an official release yet, 
+      so this example is intended for developers -- and for users who have a 
+      developer spirit.
+      This project walks
+      you through checking the DdlUtils code out of the Apache Subversion
+      repository and building it using the Ant build tool.
+      You don't need to be a java developer, in fact you don't need
+      to know any Java at all, 
+      but you should be comfortable installing software, setting environment
+      variables, and troubleshooting
+      any problems that might occur.
+   </p>
+<a name="N10030"></a><a name="Prerequisites"></a>
+<h3 class="boxed">Prerequisites</h3>
+<p>This project assumes a basic knowledge of Derby.
+         If you're new, start with the on-line
+         <a href="http://db.apache.org/derby/papers/DerbyTut/index.html">Apache
+         Derby Tutorial</a>.
+         Familiarity with XML is helpful, but not necessary.  
+         You also need the software listed below:
+      </p>
+<ul>
+         
+<li>Install the most current official release of
+            <a href="http://db.apache.org/derby/derby_downloads.html">Apache Derby</a>. </li>
+         
+<li>Install <a class="external" href="http://ant.apache.org/">Apache Ant</a> version
+         1.6.
+         Set the <span class="codefrag">ANT_HOME</span> environment variable and
+         add the Ant <span class="codefrag">bin</span> directory to your <span class="codefrag">PATH</span>.
+         </li>
+         
+<li> Install <a class="external" href="http://subversion.tigris.org/">Subversion</a>
+              and add the Subversion <span class="codefrag">bin</span> directory to your 
+              <span class="codefrag">PATH</span>.
+         </li>
+      
+</ul>
+</div>
+
+
+<a name="N10066"></a><a name="Step+1%3A+Setup+a+working+directory"></a>
+<h2 class="boxed">Step 1: Setup a working directory</h2>
+<div class="section">
+<p>
+  Somewhere on your computer create a working directory, then <span class="codefrag">cd</span> 
+  into it. 
+  This is where you'll check out and build DdlUtils, 
+  create the Derby databases,
+  <em>etc</em>.
+  Also create a <span class="codefrag">lib</span> subdirectory; this is where you'll install
+  the DdlUtils software.
+  </p>
+<p class="code-block">mkdir DdlUtils-test
+cd DdlUtils-test
+mkdir lib</p>
+</div>
+
+
+<a name="N1007D"></a><a name="Step+2%3A+Build+and+Install+DdlUtils"></a>
+<h2 class="boxed">Step 2: Build and Install DdlUtils</h2>
+<div class="section">
+<p>
+     Check out the DdlUtils repository as shown below:
+   </p>
+<p class="code-block">svn co http://svn.apache.org/repos/asf/db/ddlutils/trunk ddlutils</p>
+<p>After this command completes, you should have a local working copy of the
+    DdlUtils code in a subdirectory called <span class="codefrag">ddlutils</span>.
+    Change directory into that subdirectory and build the DdlUtils jar file
+    as shown below:
+   </p>
+<p class="code-block">cd ddlutils
+ant jar</p>
+<p>You might see some deprecation warnings in the build output, but don't
+   worry about those as long as at the end you see a 
+   <span class="codefrag">BUILD SUCCESSFUL</span> message.
+   The resulting jar will be output to a newly created 
+    <span class="codefrag">dist</span> subdirectory:
+   </p>
+<p class="code-block">
+<strong>UNIX</strong>
+$ ls dist
+DdlUtils-1.0-dev.jar 
+
+<strong>Windows</strong>
+C:\jta\DdlUtils-test\ddlutils&gt;dir dist
+ Volume in drive C has no label.
+ Volume Serial Number is 8017-F8A8
+
+ Directory of C:\jta\DdlUtils-test\ddlutils\dist
+
+03/10/2006  12:38 PM    &lt;DIR&gt;          .
+03/10/2006  12:38 PM    &lt;DIR&gt;          ..
+03/10/2006  12:38 PM           252,846 DdlUtils-1.0-dev.jar
+               1 File(s)        252,846 bytes
+               2 Dir(s)  66,830,884,864 bytes free</p>
+<p>Copy files from the <span class="codefrag">dist</span> and <span class="codefrag">lib</span> directories
+      into the <span class="codefrag">lib</span> directory you created in
+       Step 1, then <span class="codefrag">cd</span> back up to your working directory:</p>
+<p class="code-block">
+<strong>UNIX</strong>
+cp dist/*.jar ../lib
+cp lib/*.jar ../lib
+cd ..
+
+<strong>Windows</strong>
+copy dist\*.jar ..\lib
+copy lib\*.jar ..\lib
+cd ..  </p>
+</div>
+
+
+
+<a name="N100BF"></a><a name="Step+3%3A+Create+a+sample+database%3A+Books1"></a>
+<h2 class="boxed">Step 3: Create a sample database: Books1 </h2>
+<div class="section">
+<p>
+This section creates the database that the
+<a href="http://db.apache.org/torque/releases/torque-3.2/runtime/tutorial/index.html">Apache Torque Tutorial</a>
+uses,
+but you'll use Derby's <span class="codefrag">ij</span> utility to create it instead.
+</p>
+<p>
+Include <span class="codefrag">derby.jar</span> and 
+<span class="codefrag">derbytools.jar</span> in your <span class="codefrag">CLASSPATH</span>
+(<a href="http://db.apache.org/derby/papers/DerbyTut/install_software.html#derby_configure">the on-line Derby tutorial shows how to do this</a>), then create the
+database:
+</p>
+<p class="code-block">java org.apache.derby.tools.ij
+connect 'jdbc:derby:Books1;create=true'; </p>
+<p>
+Cut and paste the statements below to create the tables:
+</p>
+<p class="code-block">CREATE TABLE publisher
+(
+    publisher_id INTEGER NOT NULL,
+    name VARCHAR(128) NOT NULL,
+    PRIMARY KEY(publisher_id));
+
+CREATE TABLE author
+(
+    author_id INTEGER NOT NULL,
+    first_name VARCHAR(128) NOT NULL,
+    last_name VARCHAR(128) NOT NULL,
+    PRIMARY KEY(author_id));
+
+CREATE TABLE book
+(
+    book_id INTEGER NOT NULL,
+    title VARCHAR(255) NOT NULL,
+    isbn VARCHAR(24) NOT NULL,
+    publisher_id INTEGER NOT NULL,
+    author_id INTEGER NOT NULL,
+    PRIMARY KEY(book_id),
+    FOREIGN KEY (publisher_id) REFERENCES publisher (publisher_id)
+    ,
+    FOREIGN KEY (author_id) REFERENCES author (author_id)
+    );</p>
+<p>
+Cut and paste the statements below to insert some data:
+</p>
+<p class="code-block">insert into publisher 
+   values (1, 'Addison Wesley Professional');
+insert into author 
+   values (11, 'Joshua', 'Bloch');
+insert into author 
+   values (12, 'W.', 'Stevens');
+insert into book 
+   values (101, 'Effective Java Programming Language Guide', '0-201-31005-8', 1, 11);
+insert into book 
+   values (102, 'TCP/IP Illustrated, Volume 1', '0-201-63346-9', 1, 12);
+</p>
+<p>
+Finally, exit the database:
+</p>
+<p class="code-block">exit;</p>
+</div>
+
+
+<a name="N100F9"></a><a name="Step+4%3A+Books1+--+Export+Schema+and+Data"></a>
+<h2 class="boxed">Step 4: Books1 -- Export Schema and Data </h2>
+<div class="section">
+<p>
+This step uses the DdlUtils <span class="codefrag">DatabaseToDdlTask</span>
+to dump the <span class="codefrag">Books1</span> database to disk.
+You'll use the
+<a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils Ant tasks</a>
+to execute the export.
+</p>
+<a name="N1010C"></a><a name="Create+an+Ant+build.xml+file+with+an+export+target"></a>
+<h3 class="boxed">Create an Ant build.xml file with an export target</h3>
+<p>
+Complete source for the Ant build file is below.
+Cut and paste it into a file called <span class="codefrag">build.xml</span>:
+</p>
+<p class="code-block">&lt;?xml version="1.0"?&gt;
+&lt;project name="MigrateToDerby" basedir="."&gt;
+
+   &lt;path id="classpath"&gt;
+      &lt;fileset dir="./lib"&gt;
+         &lt;include name="**/*.jar"/&gt;
+      &lt;/fileset&gt;
+   &lt;/path&gt;
+
+   &lt;target name="export-source-db" description="Dumps db structure and data"&gt;
+      &lt;taskdef name="databaseToDdl"
+              classname="org.apache.ddlutils.task.DatabaseToDdlTask"&gt;
+         &lt;classpath refid="classpath"/&gt;
+      &lt;/taskdef&gt;
+
+      &lt;databaseToDdl&gt;
+         &lt;database url="jdbc:derby:Books1"
+                 driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+                 username=""
+                 password=""/&gt;
+
+         &lt;writeSchemaToFile outputFile="db-schema.xml"/&gt;
+         &lt;writeDataToFile outputFile="data.xml"/&gt;
+      &lt;/databaseToDdl&gt;
+
+   &lt;/target&gt;
+
+&lt;/project&gt; </p>
+<p>
+Here are a few notes about the <span class="codefrag">build.xml</span> source:
+</p>
+<ul>
+  
+<li>In Step 2 you copied all the jars from <span class="codefrag">ddlutils/lib</span> into the 
+      <span class="codefrag">lib</span> directory of the working directory. 
+      Rather than add them to the <span class="codefrag">CLASSPATH</span> variable,
+      the Ant <span class="codefrag">path</span> element 
+      adds all jars in that subdirectory to the runtime environment.
+      The <span class="codefrag">path</span> element is available to any target in this file;
+      right now, there's just one target
+      (<span class="codefrag">export-source-db</span>), but Step 5 will add another.
+  </li>
+  
+<li>The <span class="codefrag">export-source-db</span> target exports the schema and data
+      from a database. 
+     <ul>
+     
+<li>
+<span class="codefrag">database url</span> specifies all the connection parameters
+          for the database, including the <span class="codefrag">Books1</span> database.
+          This example uses the Derby Embedded JDBC driver (<span class="codefrag">derby.jar</span>), 
+          but it could just
+          as easily use the Derby Network Client JDBC driver
+          (<span class="codefrag">derbyclient.jar</span>).</li>
+     
+<li>
+<span class="codefrag">writeSchemaToFile</span> exports the schema to a file
+          called <span class="codefrag">db-schema.xml</span>.</li>
+     
+<li>
+<span class="codefrag">writeDataToFile</span> exports the data to a file
+          called <span class="codefrag">data.xml</span>.</li>
+     
+</ul>
+  
+</li>
+
+</ul>
+<a name="N10162"></a><a name="Execute+the+Ant+task"></a>
+<h3 class="boxed">Execute the Ant task</h3>
+<p>
+Now execute the task with <span class="codefrag">ant</span>:
+</p>
+<p class="code-block">ant export-source-db</p>
+<p>
+A <span class="codefrag">BUILD SUCCESSFUL</span> message indicates that that the export
+succeeded and there should be two new files in your current working directory:
+</p>
+<ul>
+  
+<li>
+<span class="codefrag">db-schema.xml</span> contains the database schema in XML format.</li>
+  
+<li>
+<span class="codefrag">data.xml</span> contains the data in XML format.</li>
+
+</ul>
+</div>
+
+
+<a name="N10187"></a><a name="Step+5%3A+Books2+--+Create+Database+and+Import+Schema+and+Data"></a>
+<h2 class="boxed">Step 5: Books2 -- Create Database and Import Schema and Data</h2>
+<div class="section">
+<p>
+This step uses the DdlUtils <span class="codefrag">DdlToDatabaseTask</span>
+to import the schema and data into a new <span class="codefrag">Books2</span> database.
+As with the export task, you'll use the
+<a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils Ant tasks</a>
+to execute the import.
+</p>
+<a name="N1019A"></a><a name="Copy+and+modify+the+db-schema.xml+file"></a>
+<h3 class="boxed">Copy and modify the db-schema.xml file</h3>
+<p>
+The export step created a file called <span class="codefrag">db-schema.xml</span>. Copy that
+to a new file called <span class="codefrag">project-schema.xml</span>:
+</p>
+<p class="code-block">
+<strong>UNIX</strong>
+cp db-schema.xml project-schema.xml
+
+<strong>Windows</strong>
+copy db-schema.xml project-schema.xml</p>
+<p>
+Now modify the first line in the <span class="codefrag">project-schema.xml</span> file 
+to name the schema:
+</p>
+<p class="code-block">&lt;database name="MigrateTest"&gt;</p>
+<p>
+If you don't provide a name, you'll get the error shown below when you
+run the Ant task to create the schema in the new database:
+</p>
+<p class="code-block">build.xml:33: Could not read schema file
+project-schema.xml: The database model has no name</p>
+<a name="N101C4"></a><a name="Add+an+import+target+to+the+build.xml"></a>
+<h3 class="boxed">Add an import target to the build.xml</h3>
+<p>
+Copy the source for the <span class="codefrag">import-target-db</span> target below
+and add it to your <span class="codefrag">build.xml</span> file:
+</p>
+<p class="code-block">   &lt;target name="import-target-db" description="Creates db and loads data"&gt;
+      &lt;taskdef name="ddlToDatabase"
+              classname="org.apache.ddlutils.task.DdlToDatabaseTask"&gt;
+         &lt;classpath refid="classpath"/&gt;
+      &lt;/taskdef&gt;
+
+      &lt;ddlToDatabase schemaFile="project-schema.xml"&gt;
+
+         &lt;database url="jdbc:derby:Books2;create=true"
+                 driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+                 username=""
+                 password=""/&gt;
+
+         &lt;writeSchemaToDatabase/&gt;
+         &lt;writeDataToDatabase datafile="data.xml"/&gt;
+
+      &lt;/ddlToDatabase&gt;
+   &lt;/target&gt; </p>
+<p>
+Here are a few notes about the source:
+</p>
+<ul>
+   
+<li> There is just one file for the schema, so it can be specified as an
+        argument to the <span class="codefrag">ddlToDatabase</span> task using the
+        <span class="codefrag">schemaFile</span> argument.
+        You can also use an embedded <span class="codefrag">fileset</span> for multiple files --
+        the 
+        <a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils
+        site</a> shows an example using that syntax.
+   </li>
+   
+<li> You might notice a <span class="codefrag">createDatabase</span> subtask in the DdlUtils 
+        examples.
+        It is omitted from this example because
+        a Derby database gets created in the connection URL.
+   </li>
+
+</ul>
+<a name="N101F4"></a><a name="Execute+the+Ant+task-N101F4"></a>
+<h3 class="boxed">Execute the Ant task</h3>
+<p>
+Execute the task with <span class="codefrag">ant</span>:
+</p>
+<p class="code-block">ant import-target-db</p>
+<p>Successful execution should look something like this:</p>
+<p class="code-block">ant import-target-db
+Buildfile: build.xml
+
+import-target-db:
+[ddlToDatabase] Read schema file /home/jta/DerbyDb/DdlUtils/project-schema.xml
+[ddlToDatabase] Mar 9, 2006 4:27:04 PM org.apache.ddlutils.platform.SqlBuilder alterDatabase
+[ddlToDatabase] INFO: Creating table AUTHOR
+[ddlToDatabase] Mar 9, 2006 4:27:04 PM org.apache.ddlutils.platform.SqlBuilder alterDatabase
+[ddlToDatabase] INFO: Creating table BOOK
+[ddlToDatabase] Mar 9, 2006 4:27:04 PM org.apache.ddlutils.platform.SqlBuilder alterDatabase
+[ddlToDatabase] INFO: Creating table PUBLISHER
+[ddlToDatabase] Mar 9, 2006 4:27:05 PM org.apache.ddlutils.platform.PlatformImplBase evaluateBatch
+[ddlToDatabase] WARNING: SQL Warning: Database 'Books2' not created, connection made to existing database instead.
+[ddlToDatabase] Mar 9, 2006 4:27:05 PM org.apache.ddlutils.platform.PlatformImplBase evaluateBatch
+[ddlToDatabase] INFO: Executed 5 SQL command(s) with 0 error(s)
+[ddlToDatabase] Written schema to database
+[ddlToDatabase] Read data file /home/jta/DerbyDb/DdlUtils/data.xml
+
+BUILD SUCCESSFUL
+Total time: 4 seconds </p>
+<p>Notice the warning in the output:</p>
+<p class="code-block">[ddlToDatabase] WARNING: SQL Warning: Database 'Books2' not created, connection made to existing database instead.</p>
+<p>This occurs because the database url in the <span class="codefrag">build.xml</span> specifies
+<span class="codefrag">create=true</span>.
+DdlUtils connects to the database twice to
+carry out the tasks. The first time it connects, the database is created.
+The second time it connects, it detects the warning that the database already
+exists.
+If you want to eliminate that warning, eliminate the <span class="codefrag">create=true</span>
+in the subtask:
+</p>
+<p class="code-block">&lt;database url="jdbc:derby:Books2"
+   driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+   username=""
+   password=""/&gt;</p>
+<p>
+If you remove the <span class="codefrag">create=true</span>,
+be sure to manually create the database before running the Ant task.
+</p>
+</div>
+
+
+<a name="N1022A"></a><a name="Step+6%3A+Verify+Migration"></a>
+<h2 class="boxed">Step 6: Verify Migration</h2>
+<div class="section">
+<p>
+You should now have two databases.
+</p>
+<p>
+One way to verify the schema in the target Derby database is to examine
+it with <a href="http://db.apache.org/derby/docs/dev/tools/ctoolsusingdblook.html">dblook</a>:
+</p>
+<p class="code-block">java org.apache.derby.tools.dblook -d jdbc:derby:Books2 -o Books2_schema.sql</p>
+<p>
+To verify the data was imported correctly, query the data in both databases:
+</p>
+<p class="code-block">ij&gt; select * from publisher;
+ij&gt; select * from author;
+ij&gt; select * from book;
+</p>
+</div>
+
+
+<a name="N10246"></a><a name="Questions%3F"></a>
+<h2 class="boxed">Questions?</h2>
+<div class="section">
+<p>Please post questions about this example to 
+   <a href="../derby_mail.html">derby-user &lt;at&gt; db.apache.org</a>.
+    Please post questions about DdlUtils to
+  <a href="http://db.apache.org/ddlutils/mail-lists.html">ddlutils-user &lt;at&gt; db.apache.org</a>.
+</p>
+</div>
+
+
+<p>
+<em>Last Updated: March 10, 2006</em>
+</p>
+
+
+</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-2006 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%A0integrate/db_ddlutils.html">derby-dev@db.apache.org</a>
+</div>
+</div>
+</body>
+</html>

Propchange: db/derby/site/trunk/build/site/integrate/db_ddlutils.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/site/trunk/build/site/integrate/db_torque.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/db_torque.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/db_torque.html (original)
+++ db/derby/site/trunk/build/site/integrate/db_torque.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/derby_plugin.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/derby_plugin.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/derby_plugin.html (original)
+++ db/derby/site/trunk/build/site/integrate/derby_plugin.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/func_spec_plugins.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/func_spec_plugins.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/func_spec_plugins.html (original)
+++ db/derby/site/trunk/build/site/integrate/func_spec_plugins.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/index.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/index.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/index.html (original)
+++ db/derby/site/trunk/build/site/integrate/index.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">
@@ -233,6 +236,15 @@
    </td>
 
 </tr>
+
+
+<tr>
+  
+<td colspan="1" rowspan="1">DdlUtils</td>
+  <td colspan="1" rowspan="1"><em><a href="db_ddlutils.html">Using DdlUtils to Migrate Databases to Derby</a></em></td>
+
+</tr>
+
 
 <tr>
   

Modified: db/derby/site/trunk/build/site/integrate/misc.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/misc.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/misc.html (original)
+++ db/derby/site/trunk/build/site/integrate/misc.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/derby_app.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/derby_app.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/derby_app.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/derby_app.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/ij.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/ij.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/ij.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/ij.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/ij2.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/ij2.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/ij2.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/ij2.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/ij_toc.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/ij_toc.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/ij_toc.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/ij_toc.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/java_project.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/java_project.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/java_project.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/java_project.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/nature.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/nature.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/nature.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/nature.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/nature_toc.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/nature_toc.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/nature_toc.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/nature_toc.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/properties.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/properties.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/properties.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/properties.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/remove_nature.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/remove_nature.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/remove_nature.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/remove_nature.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/resources.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/resources.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/resources.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/resources.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/server_toc.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/server_toc.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/server_toc.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/server_toc.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/start_server.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/start_server.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/start_server.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/start_server.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/start_toc.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/start_toc.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/start_toc.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/start_toc.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/stop_server.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/stop_server.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/stop_server.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/stop_server.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_help/sysinfo.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_help/sysinfo.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_help/sysinfo.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_help/sysinfo.html Fri Mar 10 15:21:26 2006
@@ -73,6 +73,9 @@
 <a href="../../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_howto.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_howto.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_howto.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_howto.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/integrate/plugin_slides.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/integrate/plugin_slides.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/plugin_slides.html (original)
+++ db/derby/site/trunk/build/site/integrate/plugin_slides.html Fri Mar 10 15:21:26 2006
@@ -72,6 +72,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Modified: db/derby/site/trunk/build/site/linkmap.html
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/build/site/linkmap.html?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/linkmap.html (original)
+++ db/derby/site/trunk/build/site/linkmap.html Fri Mar 10 15:21:26 2006
@@ -216,6 +216,9 @@
 <a href="binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">
@@ -918,6 +921,12 @@
 <ul>
 <li>
 <a href="integrate/../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>&nbsp;&nbsp;&nbsp;_________________________&nbsp;&nbsp;<em>cjdbc-oo</em>
+</li>
+</ul>
+      
+<ul>
+<li>
+<a href="integrate/db_ddlutils.html">DdlUtils</a>&nbsp;&nbsp;&nbsp;_________________________&nbsp;&nbsp;<em>ddlutils</em>
 </li>
 </ul>
       

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=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/papers/fortune_tut.html (original)
+++ db/derby/site/trunk/build/site/papers/fortune_tut.html Fri Mar 10 15:21:26 2006
@@ -216,6 +216,9 @@
 <a href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw">C-JDBC (SXW)</a>
 </div>
 <div class="menuitem">
+<a href="../integrate/db_ddlutils.html">DdlUtils</a>
+</div>
+<div class="menuitem">
 <a href="../integrate/DOTS_Derby.htm">DOTS Derby</a>
 </div>
 <div class="menuitem">

Added: db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml?rev=384951&view=auto
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml (added)
+++ db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml Fri Mar 10 15:21:26 2006
@@ -0,0 +1,519 @@
+<?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>Using DdlUtils to Migrate Databases to Derby</title> 
+  </header> 
+  <body> 
+
+<section>
+  <title>Overview</title>
+<p>
+<a href="http://db.apache.org/ddlutils">DdlUtils</a>, an Apache DB subproject,
+provides utilities for creating and working with Database Definition (DDL) files
+and for exporting and importing data in XML format
+<em>via</em> Ant tasks or programmatically in Java.
+</p>
+
+<p>
+Among other uses, DdlUtils makes it easier to migrate 
+from one database vendor to another.
+This paper provides a simple example for using DdlUtils to migrate a database 
+to Derby using the
+<a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils Ant tasks</a>.
+</p>
+<p>
+Now, this example features Derby as both the source and target database
+because Derby is easily available and is what the author knows.
+But it's important to realize that there's an even easier way to
+migrate a Derby database from one machine to another:
+all you need to do is copy the Derby database files. 
+You don't need to export/import the schema and data,
+not even for machines with different architectures,
+because the files that make up a Derby database are platform-independent.
+So, substitute the Derby source database in this example
+with the vendor of your choice and you'll get an idea of 
+how DdlUtils can make it easier to migrate any database to Derby.
+</p>
+
+   <section>
+      <title>Target Audience</title>
+
+   <p>DdlUtils doesn't have an official release yet, 
+      so this example is intended for developers -- and for users who have a 
+      developer spirit.
+      This project walks
+      you through checking the DdlUtils code out of the Apache Subversion
+      repository and building it using the Ant build tool.
+      You don't need to be a java developer, in fact you don't need
+      to know any Java at all, 
+      but you should be comfortable installing software, setting environment
+      variables, and troubleshooting
+      any problems that might occur.
+   </p>
+   </section>
+   <section>
+      <title>Prerequisites</title>
+
+      <p>This project assumes a basic knowledge of Derby.
+         If you're new, start with the on-line
+         <a href="http://db.apache.org/derby/papers/DerbyTut/index.html">Apache
+         Derby Tutorial</a>.
+         Familiarity with XML is helpful, but not necessary.  
+         You also need the software listed below:
+      </p>
+      <ul>
+         <li>Install the most current official release of
+            <a href="http://db.apache.org/derby/derby_downloads.html">Apache Derby</a>. </li>
+         <li>Install <a href="http://ant.apache.org/">Apache Ant</a> version
+         1.6.
+         Set the <code>ANT_HOME</code> environment variable and
+         add the Ant <code>bin</code> directory to your <code>PATH</code>.
+         </li>
+         <li> Install <a href="http://subversion.tigris.org/">Subversion</a>
+              and add the Subversion <code>bin</code> directory to your 
+              <code>PATH</code>.
+         </li>
+      </ul>
+
+   </section>
+</section>
+
+<section>
+  <title>Step 1: Setup a working directory</title>
+  <p>
+  Somewhere on your computer create a working directory, then <code>cd</code> 
+  into it. 
+  This is where you'll check out and build DdlUtils, 
+  create the Derby databases,
+  <em>etc</em>.
+  Also create a <code>lib</code> subdirectory; this is where you'll install
+  the DdlUtils software.
+  </p>
+  <p class="code-block">mkdir DdlUtils-test
+cd DdlUtils-test
+mkdir lib</p>
+</section>
+
+<section>
+  <title>Step 2: Build and Install DdlUtils</title>
+
+   <p>
+     Check out the DdlUtils repository as shown below:
+   </p>
+
+   <p class="code-block">svn co http://svn.apache.org/repos/asf/db/ddlutils/trunk ddlutils</p>
+
+   <p>After this command completes, you should have a local working copy of the
+    DdlUtils code in a subdirectory called <code>ddlutils</code>.
+    Change directory into that subdirectory and build the DdlUtils jar file
+    as shown below:
+   </p>
+
+   <p class="code-block">cd ddlutils
+ant jar</p>
+
+   <p>You might see some deprecation warnings in the build output, but don't
+   worry about those as long as at the end you see a 
+   <code>BUILD SUCCESSFUL</code> message.
+   The resulting jar will be output to a newly created 
+    <code>dist</code> subdirectory:
+   </p>
+
+   <p class="code-block"><strong>UNIX</strong>
+$ ls dist
+DdlUtils-1.0-dev.jar 
+
+<strong>Windows</strong>
+C:\jta\DdlUtils-test\ddlutils&gt;dir dist
+ Volume in drive C has no label.
+ Volume Serial Number is 8017-F8A8
+
+ Directory of C:\jta\DdlUtils-test\ddlutils\dist
+
+03/10/2006  12:38 PM    &lt;DIR&gt;          .
+03/10/2006  12:38 PM    &lt;DIR&gt;          ..
+03/10/2006  12:38 PM           252,846 DdlUtils-1.0-dev.jar
+               1 File(s)        252,846 bytes
+               2 Dir(s)  66,830,884,864 bytes free</p>
+
+   <p>Copy files from the <code>dist</code> and <code>lib</code> directories
+      into the <code>lib</code> directory you created in
+       Step 1, then <code>cd</code> back up to your working directory:</p>
+
+   <p class="code-block"><strong>UNIX</strong>
+cp dist/*.jar ../lib
+cp lib/*.jar ../lib
+cd ..
+
+<strong>Windows</strong>
+copy dist\*.jar ..\lib
+copy lib\*.jar ..\lib
+cd ..  </p>
+</section>
+
+
+<section>
+  <title>Step 3: Create a sample database: Books1 </title>
+
+<p>
+This section creates the database that the
+<a href="http://db.apache.org/torque/releases/torque-3.2/runtime/tutorial/index.html">Apache Torque Tutorial</a>
+uses,
+but you'll use Derby's <code>ij</code> utility to create it instead.
+</p>
+
+<p>
+Include <code>derby.jar</code> and 
+<code>derbytools.jar</code> in your <code>CLASSPATH</code>
+(<a href="http://db.apache.org/derby/papers/DerbyTut/install_software.html#derby_configure">the on-line Derby tutorial shows how to do this</a>), then create the
+database:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.ij
+connect 'jdbc:derby:Books1;create=true'; </p>
+
+<p>
+Cut and paste the statements below to create the tables:
+</p>
+
+<p class="code-block">CREATE TABLE publisher
+(
+    publisher_id INTEGER NOT NULL,
+    name VARCHAR(128) NOT NULL,
+    PRIMARY KEY(publisher_id));
+
+CREATE TABLE author
+(
+    author_id INTEGER NOT NULL,
+    first_name VARCHAR(128) NOT NULL,
+    last_name VARCHAR(128) NOT NULL,
+    PRIMARY KEY(author_id));
+
+CREATE TABLE book
+(
+    book_id INTEGER NOT NULL,
+    title VARCHAR(255) NOT NULL,
+    isbn VARCHAR(24) NOT NULL,
+    publisher_id INTEGER NOT NULL,
+    author_id INTEGER NOT NULL,
+    PRIMARY KEY(book_id),
+    FOREIGN KEY (publisher_id) REFERENCES publisher (publisher_id)
+    ,
+    FOREIGN KEY (author_id) REFERENCES author (author_id)
+    );</p>
+
+<p>
+Cut and paste the statements below to insert some data:
+</p>
+
+<p class="code-block">insert into publisher 
+   values (1, 'Addison Wesley Professional');
+insert into author 
+   values (11, 'Joshua', 'Bloch');
+insert into author 
+   values (12, 'W.', 'Stevens');
+insert into book 
+   values (101, 'Effective Java Programming Language Guide', '0-201-31005-8', 1, 11);
+insert into book 
+   values (102, 'TCP/IP Illustrated, Volume 1', '0-201-63346-9', 1, 12);
+</p>
+
+<p>
+Finally, exit the database:
+</p>
+
+<p class="code-block">exit;</p>
+
+</section>
+
+<section>
+  <title>Step 4: Books1 -- Export Schema and Data </title>
+
+<p>
+This step uses the DdlUtils <code>DatabaseToDdlTask</code>
+to dump the <code>Books1</code> database to disk.
+You'll use the
+<a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils Ant tasks</a>
+to execute the export.
+</p>
+
+<section>
+  <title>Create an Ant build.xml file with an export target</title>
+<p>
+Complete source for the Ant build file is below.
+Cut and paste it into a file called <code>build.xml</code>:
+</p>
+
+<p class="code-block">&lt;?xml version="1.0"?&gt;
+&lt;project name="MigrateToDerby" basedir="."&gt;
+
+   &lt;path id="classpath"&gt;
+      &lt;fileset dir="./lib"&gt;
+         &lt;include name="**/*.jar"/&gt;
+      &lt;/fileset&gt;
+   &lt;/path&gt;
+
+   &lt;target name="export-source-db" description="Dumps db structure and data"&gt;
+      &lt;taskdef name="databaseToDdl"
+              classname="org.apache.ddlutils.task.DatabaseToDdlTask"&gt;
+         &lt;classpath refid="classpath"/&gt;
+      &lt;/taskdef&gt;
+
+      &lt;databaseToDdl&gt;
+         &lt;database url="jdbc:derby:Books1"
+                 driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+                 username=""
+                 password=""/&gt;
+
+         &lt;writeSchemaToFile outputFile="db-schema.xml"/&gt;
+         &lt;writeDataToFile outputFile="data.xml"/&gt;
+      &lt;/databaseToDdl&gt;
+
+   &lt;/target&gt;
+
+&lt;/project&gt; </p>
+
+<p>
+Here are a few notes about the <code>build.xml</code> source:
+</p>
+
+<ul>
+  <li>In Step 2 you copied all the jars from <code>ddlutils/lib</code> into the 
+      <code>lib</code> directory of the working directory. 
+      Rather than add them to the <code>CLASSPATH</code> variable,
+      the Ant <code>path</code> element 
+      adds all jars in that subdirectory to the runtime environment.
+      The <code>path</code> element is available to any target in this file;
+      right now, there's just one target
+      (<code>export-source-db</code>), but Step 5 will add another.
+  </li>
+  <li>The <code>export-source-db</code> target exports the schema and data
+      from a database. 
+     <ul>
+     <li><code>database url</code> specifies all the connection parameters
+          for the database, including the <code>Books1</code> database.
+          This example uses the Derby Embedded JDBC driver (<code>derby.jar</code>), 
+          but it could just
+          as easily use the Derby Network Client JDBC driver
+          (<code>derbyclient.jar</code>).</li>
+     <li><code>writeSchemaToFile</code> exports the schema to a file
+          called <code>db-schema.xml</code>.</li>
+     <li><code>writeDataToFile</code> exports the data to a file
+          called <code>data.xml</code>.</li>
+     </ul>
+  </li>
+</ul>
+</section>
+
+<section>
+  <title>Execute the Ant task</title>
+
+<p>
+Now execute the task with <code>ant</code>:
+</p>
+
+<p class="code-block">ant export-source-db</p>
+
+<p>
+A <code>BUILD SUCCESSFUL</code> message indicates that that the export
+succeeded and there should be two new files in your current working directory:
+</p>
+
+<ul>
+  <li><code>db-schema.xml</code> contains the database schema in XML format.</li>
+  <li><code>data.xml</code> contains the data in XML format.</li>
+</ul>
+
+</section>
+</section>
+
+<section>
+  <title>Step 5: Books2 -- Create Database and Import Schema and Data</title>
+
+<p>
+This step uses the DdlUtils <code>DdlToDatabaseTask</code>
+to import the schema and data into a new <code>Books2</code> database.
+As with the export task, you'll use the
+<a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils Ant tasks</a>
+to execute the import.
+</p>
+
+<section>
+  <title>Copy and modify the db-schema.xml file</title>
+
+<p>
+The export step created a file called <code>db-schema.xml</code>. Copy that
+to a new file called <code>project-schema.xml</code>:
+</p>
+
+<p class="code-block"><strong>UNIX</strong>
+cp db-schema.xml project-schema.xml
+
+<strong>Windows</strong>
+copy db-schema.xml project-schema.xml</p>
+
+<p>
+Now modify the first line in the <code>project-schema.xml</code> file 
+to name the schema:
+</p>
+
+<p class="code-block">&lt;database name="MigrateTest"&gt;</p>
+
+<p>
+If you don't provide a name, you'll get the error shown below when you
+run the Ant task to create the schema in the new database:
+</p>
+
+<p class="code-block">build.xml:33: Could not read schema file
+project-schema.xml: The database model has no name</p>
+
+
+
+</section>
+
+<section>
+  <title>Add an import target to the build.xml</title>
+<p>
+Copy the source for the <code>import-target-db</code> target below
+and add it to your <code>build.xml</code> file:
+</p>
+
+<p class="code-block">   &lt;target name="import-target-db" description="Creates db and loads data"&gt;
+      &lt;taskdef name="ddlToDatabase"
+              classname="org.apache.ddlutils.task.DdlToDatabaseTask"&gt;
+         &lt;classpath refid="classpath"/&gt;
+      &lt;/taskdef&gt;
+
+      &lt;ddlToDatabase schemaFile="project-schema.xml"&gt;
+
+         &lt;database url="jdbc:derby:Books2;create=true"
+                 driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+                 username=""
+                 password=""/&gt;
+
+         &lt;writeSchemaToDatabase/&gt;
+         &lt;writeDataToDatabase datafile="data.xml"/&gt;
+
+      &lt;/ddlToDatabase&gt;
+   &lt;/target&gt; </p>
+
+<p>
+Here are a few notes about the source:
+</p>
+
+<ul>
+   <li> There is just one file for the schema, so it can be specified as an
+        argument to the <code>ddlToDatabase</code> task using the
+        <code>schemaFile</code> argument.
+        You can also use an embedded <code>fileset</code> for multiple files --
+        the 
+        <a href="http://db.apache.org/ddlutils/ant-tasks.html">DdlUtils
+        site</a> shows an example using that syntax.
+   </li>
+   <li> You might notice a <code>createDatabase</code> subtask in the DdlUtils 
+        examples.
+        It is omitted from this example because
+        a Derby database gets created in the connection URL.
+   </li>
+</ul>
+</section>
+
+<section>
+  <title>Execute the Ant task</title>
+
+<p>
+Execute the task with <code>ant</code>:
+</p>
+
+<p class="code-block">ant import-target-db</p>
+
+<p>Successful execution should look something like this:</p>
+
+<p class="code-block">ant import-target-db
+Buildfile: build.xml
+
+import-target-db:
+[ddlToDatabase] Read schema file /home/jta/DerbyDb/DdlUtils/project-schema.xml
+[ddlToDatabase] Mar 9, 2006 4:27:04 PM org.apache.ddlutils.platform.SqlBuilder alterDatabase
+[ddlToDatabase] INFO: Creating table AUTHOR
+[ddlToDatabase] Mar 9, 2006 4:27:04 PM org.apache.ddlutils.platform.SqlBuilder alterDatabase
+[ddlToDatabase] INFO: Creating table BOOK
+[ddlToDatabase] Mar 9, 2006 4:27:04 PM org.apache.ddlutils.platform.SqlBuilder alterDatabase
+[ddlToDatabase] INFO: Creating table PUBLISHER
+[ddlToDatabase] Mar 9, 2006 4:27:05 PM org.apache.ddlutils.platform.PlatformImplBase evaluateBatch
+[ddlToDatabase] WARNING: SQL Warning: Database 'Books2' not created, connection made to existing database instead.
+[ddlToDatabase] Mar 9, 2006 4:27:05 PM org.apache.ddlutils.platform.PlatformImplBase evaluateBatch
+[ddlToDatabase] INFO: Executed 5 SQL command(s) with 0 error(s)
+[ddlToDatabase] Written schema to database
+[ddlToDatabase] Read data file /home/jta/DerbyDb/DdlUtils/data.xml
+
+BUILD SUCCESSFUL
+Total time: 4 seconds </p>
+
+<p>Notice the warning in the output:</p>
+
+<p class="code-block">[ddlToDatabase] WARNING: SQL Warning: Database 'Books2' not created, connection made to existing database instead.</p>
+
+<p>This occurs because the database url in the <code>build.xml</code> specifies
+<code>create=true</code>.
+DdlUtils connects to the database twice to
+carry out the tasks. The first time it connects, the database is created.
+The second time it connects, it detects the warning that the database already
+exists.
+If you want to eliminate that warning, eliminate the <code>create=true</code>
+in the subtask:
+</p>
+<p class="code-block">&lt;database url="jdbc:derby:Books2"
+   driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+   username=""
+   password=""/&gt;</p>
+
+<p>
+If you remove the <code>create=true</code>,
+be sure to manually create the database before running the Ant task.
+</p>
+</section>
+
+</section>
+
+<section>
+<title>Step 6: Verify Migration</title>
+
+<p>
+You should now have two databases.
+</p>
+
+<p>
+One way to verify the schema in the target Derby database is to examine
+it with <a href="http://db.apache.org/derby/docs/dev/tools/ctoolsusingdblook.html">dblook</a>:
+</p>
+
+<p class="code-block">java org.apache.derby.tools.dblook -d jdbc:derby:Books2 -o Books2_schema.sql</p>
+
+<p>
+To verify the data was imported correctly, query the data in both databases:
+</p>
+
+<p class="code-block">ij&gt; select * from publisher;
+ij&gt; select * from author;
+ij&gt; select * from book;
+</p>
+
+</section>
+
+<section>
+  <title>Questions?</title>
+
+ <p>Please post questions about this example to 
+   <a href="../derby_mail.html">derby-user &lt;at&gt; db.apache.org</a>.
+    Please post questions about DdlUtils to
+  <a href="http://db.apache.org/ddlutils/mail-lists.html">ddlutils-user &lt;at&gt; db.apache.org</a>.
+</p>
+
+</section>
+
+<p><em>Last Updated: March 10, 2006</em></p>
+
+</body>
+</document>

Propchange: db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/site/trunk/src/documentation/content/xdocs/integrate/index.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/integrate/index.xml?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/integrate/index.xml (original)
+++ db/derby/site/trunk/src/documentation/content/xdocs/integrate/index.xml Fri Mar 10 15:21:26 2006
@@ -32,6 +32,12 @@
      Software License 2.0.)</em>
    </td>
 </tr>
+
+<tr>
+  <td>DdlUtils</td>
+  <td><em><a href="db_ddlutils.html">Using DdlUtils to Migrate Databases to Derby</a></em></td>
+</tr>
+
 <tr>
   <td>DOTS Derby</td>
   <td><a href="DOTS_Derby.htm"><em>Running DOTS 

Modified: db/derby/site/trunk/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewcvs/db/derby/site/trunk/src/documentation/content/xdocs/site.xml?rev=384951&r1=384950&r2=384951&view=diff
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/site.xml (original)
+++ db/derby/site/trunk/src/documentation/content/xdocs/site.xml Fri Mar 10 15:21:26 2006
@@ -71,6 +71,7 @@
       <uses      label="UsesOfDerby"  href="http://wiki.apache.org/db-derby/UsesOfDerby"/>
       <cjdbc-pdf label="C-JDBC (PDF)" href="../binaries/HOWTO_CJDBC_Derby_v0.2.pdf"/>
       <cjdbc-oo  label="C-JDBC (SXW)" href="../binaries/HOWTO_CJDBC_Derby_v0.2.sxw"/>
+      <ddlutils  label="DdlUtils"     href="db_ddlutils.html"/>
       <dots      label="DOTS Derby"   href="DOTS_Derby.htm"/>
       <dots      label="DOTS System"  href="../binaries/UsingDotsDerbySystemTest.pdf"/>
       <emma      label="EMMA"         href="../binaries/DerbyCodeCoverageUsingEmma.pdf"/>



Mime
View raw message