db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r429935 - in /db/derby/code/trunk: java/demo/ java/demo/workingwithderby/ tools/release/
Date Wed, 09 Aug 2006 03:00:39 GMT
Author: fuzzylogic
Date: Tue Aug  8 20:00:38 2006
New Revision: 429935

URL: http://svn.apache.org/viewvc?rev=429935&view=rev
Log:
DERBY-1596: Add Working With Derby java files.

Committed for Stan Bradbury <Stan.Bradbury@gmail.com>

Added:
    db/derby/code/trunk/java/demo/workingwithderby/
    db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java   (with props)
    db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java   (with props)
    db/derby/code/trunk/java/demo/workingwithderby/WwdUtils.java   (with props)
    db/derby/code/trunk/java/demo/workingwithderby/readme.html   (with props)
Modified:
    db/derby/code/trunk/java/demo/build.xml
    db/derby/code/trunk/java/demo/demo.html
    db/derby/code/trunk/java/demo/navbar.html
    db/derby/code/trunk/tools/release/build.xml

Modified: db/derby/code/trunk/java/demo/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/build.xml?rev=429935&r1=429934&r2=429935&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/build.xml (original)
+++ db/derby/code/trunk/java/demo/build.xml Tue Aug  8 20:00:38 2006
@@ -92,6 +92,24 @@
         <pathelement path="${java13compile.classpath};${jcc};${jta1_2}"/>
       </classpath>
     </javac>
+    <javac
+      source="1.3"
+      target="1.3"
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}"
+      srcdir="${derby.demo.src.dir}/workingwithderby"
+      destdir="${out.dir}">
+      <classpath>
+        <pathelement location="${javasrc.dir};${jcc};${jta1_2}"/>
+        <pathelement path="${java13compile.classpath};${jcc};${jta1_2}"/>
+      </classpath>
+    </javac>
     <ant target="compile" dir="toursdb"/>
   </target>
 

Modified: db/derby/code/trunk/java/demo/demo.html
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/demo.html?rev=429935&r1=429934&r2=429935&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/demo.html (original)
+++ db/derby/code/trunk/java/demo/demo.html Tue Aug  8 20:00:38 2006
@@ -23,7 +23,9 @@
 <BODY>
 
 <H1>Example Apache Derby Programs</H1>
-<p>This directory contains example programs. For a complete description, see <A
href="http://db.apache.org/derby/manuals/index.html">Getting Started with Apache Derby</A>
and the <A href="http://db.apache.org/derby/manuals/index.html">Apache Derby Server
and Administration Guide</A>.</p>
+<p>This directory contains example programs. For a complete description, see <A
href="http://db.apache.org/derby/manuals/index.html">Getting Started with Apache Derby</A>
the <A href="http://db.apache.org/derby/manuals/index.html">Apache Derby Server and
Administration Guide</A> and <A
+href="http://db.apache.org/derby/manuals/index.html">Working With Derby</A>
+.</p>
 <UL>
 	<LI><A href="simple/example.html">Simple</A>
         <p class="BodyRelative">A very simple JDBC application that boots the driver,
@@ -35,6 +37,9 @@
     <p class="BodyRelative">The toursdb is provided as an example and demo database
to illustrate some functionality of the Derby RDBMS. Many of the examples in the Derby documentation
use tables that exist in the toursdb database. The document describes the tables, the names
and types of columns in those tables, and the constraints, indexes, and triggers in the database.
     </p>
 </li>
+	<LI><A href="workingwithderby/readme.html">Working With Derby</A>
+        <p class="BodyRelative">Programs described and modified as part of the activities
documented in the <A href="../../docs/html/workingwithderby/index.html">Working With
Derby</A> manual.</p></LI>
+</LI>
 </UL>
 
 </BODY>

Modified: db/derby/code/trunk/java/demo/navbar.html
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/navbar.html?rev=429935&r1=429934&r2=429935&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/navbar.html (original)
+++ db/derby/code/trunk/java/demo/navbar.html Tue Aug  8 20:00:38 2006
@@ -27,6 +27,7 @@
 <p class="NavBar1"><a href="simple/example.html" target="mainPage">Simple</a></p>
 <p class="NavBar1"><a href="nserverdemo/readme.html" target="mainPage">Network
Server Sample Programs</a></p>
 <p class="NavBar1"><a href="toursdb/toursdb_readme.html" target="mainPage">ToursDB
sample database schema</a></p>
+<p class="NavBar1"><a href="workingwithderby/readme.html" target="mainPage">Working
With Derby Activities Programs</a></p>
 <p class="NavBar"><a href="http://db.apache.org/derby/manuals/index.html" target="_top">Documentation
Home</a></p>
 
 </BODY>

Added: db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java?rev=429935&view=auto
==============================================================================
--- db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java (added)
+++ db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java Tue Aug  8 20:00:38
2006
@@ -0,0 +1,170 @@
+/*     WwdClientExample.java										 
+ **  This sample program is described in the document Working With Derby
+
+       Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+
+             http://www.apache.org/licenses/LICENSE-2.0
+
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.    
+*/
+//   ## INITIALIZATION SECTION ##
+//  Include the java SQL classes 
+import java.sql.*;
+
+public class WwdClientExample
+{
+    public static void main(String[] args)
+   {
+   //   ## DEFINE VARIABLES SECTION ##
+   // define the driver to use 
+      String driver = "org.apache.derby.jdbc.ClientDriver";
+   // the database name  
+      String dbName="jdbcDemoDB";
+   // define the Derby connection URL to use 
+      String connectionURL = "jdbc:derby://localhost:1527/" + dbName + ";create=true";
+
+      Connection conn = null;
+      Statement s;
+      PreparedStatement psInsert;
+      ResultSet myWishes;
+      String printLine = "  __________________________________________________";
+      String createString = "CREATE TABLE WISH_LIST  "
+        +  "(WISH_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY " 
+        +  "   CONSTRAINT WISH_PK PRIMARY KEY, " 
+        +  " ENTRY_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "
+        +  " WISH_ITEM VARCHAR(32) NOT NULL) " ;
+      String answer;
+
+      //   Beginning of JDBC code sections   
+      //   ## LOAD DRIVER SECTION ##
+      try	        {
+          /*
+          **  Load the Derby driver. 
+          **     When the embedded Driver is used this action start the Derby engine.
+          **  Catch an error and suggest a CLASSPATH problem
+           */
+          Class.forName(driver); 
+          System.out.println(driver + " loaded. ");
+      } catch(java.lang.ClassNotFoundException e)     {
+          System.err.print("ClassNotFoundException: ");
+          System.err.println(e.getMessage());
+          System.out.println("\n    >>> Please check your CLASSPATH variable   <<<\n");
+      }
+      //  Beginning of Primary DB access section
+      //   ## BOOT DATABASE SECTION ##
+     try {
+            // Create (if needed) and connect to the database
+            conn = DriverManager.getConnection(connectionURL);		 
+            System.out.println("Connected to database " + dbName);
+            
+            //   ## INITIAL SQL SECTION ## 
+            //   Create a statement to issue simple commands.  
+            s = conn.createStatement();
+             // Call utility method to check if table exists.
+             //      Create the table if needed
+             if (! WwdUtils.wwdChk4Table(conn))
+             {  
+                  System.out.println (" . . . . creating table WISH_LIST");
+                  s.execute(createString);
+              }
+             //  Prepare the insert statement to use 
+            psInsert = conn.prepareStatement("insert into WISH_LIST(WISH_ITEM) values (?)");
+
+            //   ## ADD / DISPLAY RECORD SECTION ## 
+            //  The Add-Record Loop - continues until 'exit' is entered 
+            do {
+                // Call utility method to ask user for input 
+                answer = WwdUtils.getWishItem();
+                // Check if it is time to EXIT, if not insert the data   
+                if (! answer.equals("exit"))
+                {
+                    //Insert the text entered into the WISH_ITEM table
+                    psInsert.setString(1,answer);
+                    psInsert.executeUpdate();  
+
+                    //   Select all records in the WISH_LIST table
+                    myWishes = s.executeQuery("select ENTRY_DATE, WISH_ITEM from WISH_LIST
order by ENTRY_DATE");
+
+                    //  Loop through the ResultSet and print the data 
+                    System.out.println(printLine);
+                    while (myWishes.next())
+                     {
+                           System.out.println("On " + myWishes.getTimestamp(1) + " I wished
for " + myWishes.getString(2));
+                      }
+                      System.out.println(printLine);
+                      //  Close the resultSet 
+                      myWishes.close();
+                 }       //  END of IF block   
+             // Check if it is time to EXIT, if so end the loop  
+              } while (! answer.equals("exit")) ;  // End of do-while loop 
+
+             // Release the resources (clean up )
+             psInsert.close();
+             s.close();
+            conn.close();						
+            System.out.println("Closed connection");
+
+            //   ## DATABASE SHUTDOWN SECTION ## 
+            /*** In embedded mode, an application should shut down Derby.
+               Shutdown throws the XJ015 exception to confirm success. ***/			
+            if (driver.equals("org.apache.derby.jdbc.EmbeddedDriver")) {
+               boolean gotSQLExc = false;
+               try {
+                  DriverManager.getConnection("jdbc:derby:;shutdown=true");
+               } catch (SQLException se)  {	
+                  if ( se.getSQLState().equals("XJ015") ) {		
+                     gotSQLExc = true;
+                  }
+               }
+               if (!gotSQLExc) {
+               	  System.out.println("Database did not shut down normally");
+               }  else  {
+                  System.out.println("Database shut down normally");	
+               }  
+            }
+            
+         //  Beginning of the primary catch block: uses errorPrint method
+         }  catch (Throwable e)  {   
+            /*       Catch all exceptions and pass them to 
+            **       the exception reporting method             */
+            System.out.println(" . . . exception thrown:");
+            errorPrint(e);
+         }
+         System.out.println("Working With Derby JDBC program ending.");
+      }
+     //   ## DERBY EXCEPTION REPORTING CLASSES  ## 
+    /***     Exception reporting methods
+    **      with special handling of SQLExceptions
+    ***/
+      static void errorPrint(Throwable e) {
+         if (e instanceof SQLException) 
+            SQLExceptionPrint((SQLException)e);
+         else {
+            System.out.println("A non SQL error occured.");
+            e.printStackTrace();
+         }   
+      }  // END errorPrint 
+
+    //  Iterates through a stack of SQLExceptions 
+      static void SQLExceptionPrint(SQLException sqle) {
+         while (sqle != null) {
+            System.out.println("\n---SQLException Caught---\n");
+            System.out.println("SQLState:   " + (sqle).getSQLState());
+            System.out.println("Severity: " + (sqle).getErrorCode());
+            System.out.println("Message:  " + (sqle).getMessage()); 
+            sqle.printStackTrace();  
+            sqle = sqle.getNextException();
+         }
+   }  //  END SQLExceptionPrint   	
+}

Propchange: db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java?rev=429935&view=auto
==============================================================================
--- db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java (added)
+++ db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java Tue Aug  8 20:00:38 2006
@@ -0,0 +1,174 @@
+/*
+     Derby - WwdEmbedded.java ( described in the document Working With Derby)
+
+       Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+
+             http://www.apache.org/licenses/LICENSE-2.0
+
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.    
+
+*/
+/*											 
+ **  This sample program is described in the document Working With Derby
+*/
+//   ## INITIALIZATION SECTION ##
+//  Include the java SQL classes 
+import java.sql.*;
+
+public class WwdEmbedded
+{
+    public static void main(String[] args)
+   {
+   //   ## DEFINE VARIABLES SECTION ##
+   // define the driver to use 
+      String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+   // the database name  
+      String dbName="jdbcDemoDB";
+   // define the Derby connection URL to use 
+      String connectionURL = "jdbc:derby:" + dbName + ";create=true";
+
+      Connection conn = null;
+      Statement s;
+      PreparedStatement psInsert;
+      ResultSet myWishes;
+      String printLine = "  __________________________________________________";
+      String createString = "CREATE TABLE WISH_LIST  "
+        +  "(WISH_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY " 
+        +  "   CONSTRAINT WISH_PK PRIMARY KEY, " 
+        +  " ENTRY_DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "
+        +  " WISH_ITEM VARCHAR(32) NOT NULL) " ;
+      String answer;
+
+      //   Beginning of JDBC code sections   
+      //   ## LOAD DRIVER SECTION ##
+      try	        {
+          /*
+          **  Load the Derby driver. 
+          **     When the embedded Driver is used this action start the Derby engine.
+          **  Catch an error and suggest a CLASSPATH problem
+           */
+          Class.forName(driver); 
+          System.out.println(driver + " loaded. ");
+      } catch(java.lang.ClassNotFoundException e)     {
+          System.err.print("ClassNotFoundException: ");
+          System.err.println(e.getMessage());
+          System.out.println("\n    >>> Please check your CLASSPATH variable   <<<\n");
+      }
+      //  Beginning of Primary DB access section
+      //   ## BOOT DATABASE SECTION ##
+     try {
+            // Create (if needed) and connect to the database
+            conn = DriverManager.getConnection(connectionURL);		 
+            System.out.println("Connected to database " + dbName);
+            
+            //   ## INITIAL SQL SECTION ## 
+            //   Create a statement to issue simple commands.  
+            s = conn.createStatement();
+             // Call utility method to check if table exists.
+             //      Create the table if needed
+             if (! WwdUtils.wwdChk4Table(conn))
+             {  
+                  System.out.println (" . . . . creating table WISH_LIST");
+                  s.execute(createString);
+              }
+             //  Prepare the insert statement to use 
+            psInsert = conn.prepareStatement("insert into WISH_LIST(WISH_ITEM) values (?)");
+
+            //   ## ADD / DISPLAY RECORD SECTION ## 
+            //  The Add-Record Loop - continues until 'exit' is entered 
+            do {
+                // Call utility method to ask user for input 
+                answer = WwdUtils.getWishItem();
+                // Check if it is time to EXIT, if not insert the data   
+                if (! answer.equals("exit"))
+                {
+                    //Insert the text entered into the WISH_ITEM table
+                    psInsert.setString(1,answer);
+                    psInsert.executeUpdate();  
+
+                    //   Select all records in the WISH_LIST table
+                    myWishes = s.executeQuery("select ENTRY_DATE, WISH_ITEM from WISH_LIST
order by ENTRY_DATE");
+
+                    //  Loop through the ResultSet and print the data 
+                    System.out.println(printLine);
+                    while (myWishes.next())
+                     {
+                           System.out.println("On " + myWishes.getTimestamp(1) + " I wished
for " + myWishes.getString(2));
+                      }
+                      System.out.println(printLine);
+                      //  Close the resultSet 
+                      myWishes.close();
+                 }       //  END of IF block   
+             // Check if it is time to EXIT, if so end the loop  
+              } while (! answer.equals("exit")) ;  // End of do-while loop 
+
+             // Release the resources (clean up )
+             psInsert.close();
+             s.close();
+            conn.close();						
+            System.out.println("Closed connection");
+
+            //   ## DATABASE SHUTDOWN SECTION ## 
+            /*** In embedded mode, an application should shut down Derby.
+               Shutdown throws the XJ015 exception to confirm success. ***/			
+            if (driver.equals("org.apache.derby.jdbc.EmbeddedDriver")) {
+               boolean gotSQLExc = false;
+               try {
+                  DriverManager.getConnection("jdbc:derby:;shutdown=true");
+               } catch (SQLException se)  {	
+                  if ( se.getSQLState().equals("XJ015") ) {		
+                     gotSQLExc = true;
+                  }
+               }
+               if (!gotSQLExc) {
+               	  System.out.println("Database did not shut down normally");
+               }  else  {
+                  System.out.println("Database shut down normally");	
+               }  
+            }
+            
+         //  Beginning of the primary catch block: uses errorPrint method
+         }  catch (Throwable e)  {   
+            /*       Catch all exceptions and pass them to 
+            **       the exception reporting method             */
+            System.out.println(" . . . exception thrown:");
+            errorPrint(e);
+         }
+         System.out.println("Working With Derby JDBC program ending.");
+      }
+     //   ## DERBY EXCEPTION REPORTING CLASSES  ## 
+    /***     Exception reporting methods
+    **      with special handling of SQLExceptions
+    ***/
+      static void errorPrint(Throwable e) {
+         if (e instanceof SQLException) 
+            SQLExceptionPrint((SQLException)e);
+         else {
+            System.out.println("A non SQL error occured.");
+            e.printStackTrace();
+         }   
+      }  // END errorPrint 
+
+    //  Iterates through a stack of SQLExceptions 
+      static void SQLExceptionPrint(SQLException sqle) {
+         while (sqle != null) {
+            System.out.println("\n---SQLException Caught---\n");
+            System.out.println("SQLState:   " + (sqle).getSQLState());
+            System.out.println("Severity: " + (sqle).getErrorCode());
+            System.out.println("Message:  " + (sqle).getMessage()); 
+            sqle.printStackTrace();  
+            sqle = sqle.getNextException();
+         }
+   }  //  END SQLExceptionPrint   	
+}

Propchange: db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/demo/workingwithderby/WwdUtils.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/workingwithderby/WwdUtils.java?rev=429935&view=auto
==============================================================================
--- db/derby/code/trunk/java/demo/workingwithderby/WwdUtils.java (added)
+++ db/derby/code/trunk/java/demo/workingwithderby/WwdUtils.java Tue Aug  8 20:00:38 2006
@@ -0,0 +1,85 @@
+/*
+     Derby - WwdUtils.java - utilitity methods used by WwdEmbedded.java
+
+        Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+
+             http://www.apache.org/licenses/LICENSE-2.0
+
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.    
+
+*/
+
+import java.io.*;
+import java.sql.*;
+public class WwdUtils {
+
+/*****************
+**  Asks user to enter a wish list item or 'exit' to exit the loop - returns 
+**       the string entered - loop should exit when the string 'exit' is returned
+******************/
+   public static String getWishItem() {
+      BufferedReader br = new BufferedReader( new InputStreamReader(System.in));
+      String ans = "";
+      try
+      {
+         while ( ans.length() == 0 ) {
+            System.out.println("Enter wish-list item (enter exit to end): ");
+            ans = br.readLine();
+            if ( ans.length() == 0 ) 
+               System.out.print("Nothing entered: ");
+         }
+      } catch (java.io.IOException e) {
+         System.out.println("Could not read response from stdin");	
+         }
+         return ans;
+    }  /**  END  getWishItem  ***/
+
+/***      Check for  WISH_LIST table    ****/
+   public static boolean wwdChk4Table (Connection conTst ) throws SQLException {
+      boolean chk = true;
+      boolean doCreate = false;
+      try {
+         Statement s = conTst.createStatement();
+         s.execute("update WISH_LIST set ENTRY_DATE = CURRENT_TIMESTAMP, WISH_ITEM = 'TEST
ENTRY' where 1=3");
+      }  catch (SQLException sqle) {
+         String theError = (sqle).getSQLState();
+         //   System.out.println("  Utils GOT:  " + theError);
+         /** If table exists will get -  WARNING 02000: No row was found **/
+         if (theError.equals("42X05"))   // Table does not exist
+         {  return false;
+          }  else if (theError.equals("42X14") || theError.equals("42821"))  {
+             System.out.println("WwdChk4Table: Incorrect table definition. Drop table WISH_LIST
and rerun this program");
+             throw sqle;   
+          } else { 
+             System.out.println("WwdChk4Table: Unhandled SQLException" );
+             throw sqle; 
+          }
+      }
+      //  System.out.println("Just got the warning - table exists OK ");
+      return true;
+   }  /*** END wwdInitTable  **/
+
+
+   public static void main  (String[] args) {
+   // This method allows stand-alone testing of the getWishItem method
+      String answer;
+      do {
+         answer = getWishItem();
+         if (! answer.equals("exit"))  {
+            System.out.println ("You said: " + answer);
+         }
+      } while (! answer.equals("exit")) ;
+   }
+
+}
\ No newline at end of file

Propchange: db/derby/code/trunk/java/demo/workingwithderby/WwdUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/demo/workingwithderby/readme.html
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/workingwithderby/readme.html?rev=429935&view=auto
==============================================================================
--- db/derby/code/trunk/java/demo/workingwithderby/readme.html (added)
+++ db/derby/code/trunk/java/demo/workingwithderby/readme.html Tue Aug  8 20:00:38 2006
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<META http-equiv="Content-Style-Type" content="text/css">
+<TITLE>Example Programs</TITLE>
+<link rel="stylesheet" type="text/css" href="../csfull.css" title="sample">
+</HEAD>
+<BODY>
+
+<H1>The Working With Derby Sample Programs</H1>
+<P>The programs in this directory are described in the the <A href="../../../docs/html/workingwithderby/index.html">Working
With Derby</A> manual. Please see this document for more information.</P>
+<UL>
+  <LI>
+  <p class="BodyRelative"><A href="WwdEmbedded.java">WwdEmbedded.java</A></p>
+  <p class="BodyRelative">A very basic JDBC program that uses Derby. This is the primary
program
+  example used in the JDBC sections of  Working With Derby. It is described
+  in detail in that document.</p>
+  </LI>
+  <LI><p class="BodyRelative"><A href="WwdClientExample.java">WwdClientExample.java</A></p>
+	<p class="BodyRelative">This is an example of what the WwdClient.java program created
as part
+  of one of the Working With Derby activities will look like. A working copy of that code
+  is provided here for people interested in examining the code without performing
+  the edits described in the activity.</p></LI>
+</UL>
+<UL>
+  <LI><A href="WwdUtils.java">WwdUtils.java</A>
+</UL>
+<BLOCKQUOTE>These are utility methods used by the Working With Derby programs that
+are not described in the document. The processing performed by these methods
+does not demonstrate basic JDBC processing and so is outside the scope
+of an introductory document like Working With Derby. These methods provide
+environment validation and manage user input so the program is more robust.
+The code is provided here for people interested in examining the processing.
+It contains three methods:<BR>
+<OL>
+  <LI>getWishItem - Prompts for user input and returns the entered text, if any,
+  to the calling program. Handles I/O Exceptions and insists that some text
+  is entered.
+  <LI>wwdChk4Table - Checks if the table needed by the program already exists
+  and is defined properly. Handles certain errors that could occur.
+  <LI>main - Allows standalone testing of the getWishItem method.
+</OL>
+</BLOCKQUOTE>
+</BODY>
+</HTML>

Propchange: db/derby/code/trunk/java/demo/workingwithderby/readme.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/tools/release/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/release/build.xml?rev=429935&r1=429934&r2=429935&view=diff
==============================================================================
--- db/derby/code/trunk/tools/release/build.xml (original)
+++ db/derby/code/trunk/tools/release/build.xml Tue Aug  8 20:00:38 2006
@@ -89,6 +89,9 @@
                   prefix="${derby.bin}/demo/programs/nserverdemo"/>
       <zipfileset dir="${basedir}/java/demo/toursdb" includes="toursdb/**,toursdb.jar"
                   prefix="${derby.bin}/demo/databases"/>
+      <zipfileset dir="${basedir}/classes" includes="Wwd*.class"
+                  prefix="${derby.bin}/demo/programs/workingwithderby"/>
+
       <!-- docs -->
       <zipfileset dir="${docs.out}" includes="**/*.html"
                   prefix="${derby.bin}/docs/html"/>
@@ -126,6 +129,8 @@
                   prefix="${derby.bin}/demo/programs/nserverdemo"/>
       <tarfileset dir="${basedir}/java/demo/toursdb" includes="toursdb/**,toursdb.jar"
                   prefix="${derby.bin}/demo/databases"/>
+      <tarfileset dir="${basedir}/classes" includes="Wwd*.class"
+                  prefix="${derby.bin}/demo/programs/workingwithderby"/>
       <!-- docs -->
       <tarfileset dir="${docs.out}" includes="**/*.html"
 		          prefix="${derby.bin}/docs/html"/>



Mime
View raw message