db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r384959 - in /db/derby/site/trunk: build/site/integrate/db_ddlutils.html src/documentation/content/xdocs/integrate/db_ddlutils.xml
Date Sat, 11 Mar 2006 00:13:38 GMT
Author: jta
Date: Fri Mar 10 16:13:36 2006
New Revision: 384959

URL: http://svn.apache.org/viewcvs?rev=384959&view=rev
Log:
Modified the "Using DdlUtils to Migrate Databases to Derby" paper.  Added 
the createDatabase subtask into the import target -- thanks to Tom Dudziak.

Modified:
    db/derby/site/trunk/build/site/integrate/db_ddlutils.html
    db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml

Modified: 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=384959&r1=384958&r2=384959&view=diff
==============================================================================
--- db/derby/site/trunk/build/site/integrate/db_ddlutils.html (original)
+++ db/derby/site/trunk/build/site/integrate/db_ddlutils.html Fri Mar 10 16:13:36 2006
@@ -240,7 +240,7 @@
 <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>
+<a href="#Execute+the+Ant+task-N10203">Execute the Ant task</a>
 </li>
 </ul>
 </li>
@@ -618,11 +618,12 @@
 
       &lt;ddlToDatabase schemaFile="project-schema.xml"&gt;
 
-         &lt;database url="jdbc:derby:Books2;create=true"
+         &lt;database url="jdbc:derby:Books2"
                  driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
                  username=""
                  password=""/&gt;
 
+         &lt;createDatabase failonerror="false"/&gt;
          &lt;writeSchemaToDatabase/&gt;
          &lt;writeDataToDatabase datafile="data.xml"/&gt;
 
@@ -642,14 +643,19 @@
         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> The <span class="codefrag">createDatabase</span> subtask creates the
Derby database.
+   </li>
+   
+<li> The <span class="codefrag">writeSchemaToDatabase</span> subtask creates
the schema
+        from the file specified by <span class="codefrag">schemaFile</span>.
+   </li>
+   
+<li> The <span class="codefrag">writeDataToDatabase</span> subtask loads
the data from the
+        specified data file.
    </li>
 
 </ul>
-<a name="N101F4"></a><a name="Execute+the+Ant+task-N101F4"></a>
+<a name="N10203"></a><a name="Execute+the+Ant+task-N10203"></a>
 <h3 class="boxed">Execute the Ant task</h3>
 <p>
 Execute the task with <span class="codefrag">ant</span>:
@@ -661,44 +667,24 @@
 
 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] Created database
+[ddlToDatabase] Mar 10, 2006 4:03:05 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] Mar 10, 2006 4:03:05 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] Mar 10, 2006 4:03:05 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] Mar 10, 2006 4:03:06 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>
+<a name="N1021C"></a><a name="Step+6%3A+Verify+Migration"></a>
 <h2 class="boxed">Step 6: Verify Migration</h2>
 <div class="section">
 <p>
@@ -719,7 +705,7 @@
 </div>
 
 
-<a name="N10246"></a><a name="Questions%3F"></a>
+<a name="N10238"></a><a name="Questions%3F"></a>
 <h2 class="boxed">Questions?</h2>
 <div class="section">
 <p>Please post questions about this example to 

Modified: 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=384959&r1=384958&r2=384959&view=diff
==============================================================================
--- db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml (original)
+++ db/derby/site/trunk/src/documentation/content/xdocs/integrate/db_ddlutils.xml Fri Mar
10 16:13:36 2006
@@ -387,11 +387,12 @@
 
       &lt;ddlToDatabase schemaFile="project-schema.xml"&gt;
 
-         &lt;database url="jdbc:derby:Books2;create=true"
+         &lt;database url="jdbc:derby:Books2"
                  driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
                  username=""
                  password=""/&gt;
 
+         &lt;createDatabase failonerror="false"/&gt;
          &lt;writeSchemaToDatabase/&gt;
          &lt;writeDataToDatabase datafile="data.xml"/&gt;
 
@@ -411,10 +412,13 @@
         <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> The <code>createDatabase</code> subtask creates the Derby database.
+   </li>
+   <li> The <code>writeSchemaToDatabase</code> subtask creates the schema
+        from the file specified by <code>schemaFile</code>.
+   </li>
+   <li> The <code>writeDataToDatabase</code> subtask loads the data from
the
+        specified data file.
    </li>
 </ul>
 </section>
@@ -435,15 +439,14 @@
 
 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] Created database
+[ddlToDatabase] Mar 10, 2006 4:03:05 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] Mar 10, 2006 4:03:05 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] Mar 10, 2006 4:03:05 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] Mar 10, 2006 4:03:06 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
@@ -451,28 +454,6 @@
 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>



Mime
View raw message