Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 55030 invoked from network); 20 Jun 2007 22:30:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jun 2007 22:30:29 -0000 Received: (qmail 86807 invoked by uid 500); 20 Jun 2007 22:30:33 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 86717 invoked by uid 500); 20 Jun 2007 22:30:33 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 86706 invoked by uid 99); 20 Jun 2007 22:30:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 15:30:32 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 15:30:28 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id E6A0C1A981A; Wed, 20 Jun 2007 15:30:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r549281 - in /db/derby/docs/branches/10.3/src/getstart: getstartderby.ditamap rwwdactivity3.dita twwdactivity3_Setup.dita twwdactivity4.dita Date: Wed, 20 Jun 2007 22:30:07 -0000 To: derby-commits@db.apache.org From: myrnavl@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070620223007.E6A0C1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: myrnavl Date: Wed Jun 20 15:30:02 2007 New Revision: 549281 URL: http://svn.apache.org/viewvc?view=rev&rev=549281 Log: DERBY-2839 - item 3, merge revision 549263 from docs trunk to refer to actual demo files in workingwithderby directory. Modified: db/derby/docs/branches/10.3/src/getstart/getstartderby.ditamap db/derby/docs/branches/10.3/src/getstart/rwwdactivity3.dita db/derby/docs/branches/10.3/src/getstart/twwdactivity3_Setup.dita db/derby/docs/branches/10.3/src/getstart/twwdactivity4.dita Modified: db/derby/docs/branches/10.3/src/getstart/getstartderby.ditamap URL: http://svn.apache.org/viewvc/db/derby/docs/branches/10.3/src/getstart/getstartderby.ditamap?view=diff&rev=549281&r1=549280&r2=549281 ============================================================================== --- db/derby/docs/branches/10.3/src/getstart/getstartderby.ditamap (original) +++ db/derby/docs/branches/10.3/src/getstart/getstartderby.ditamap Wed Jun 20 15:30:02 2007 @@ -189,7 +189,7 @@ - + Modified: db/derby/docs/branches/10.3/src/getstart/rwwdactivity3.dita URL: http://svn.apache.org/viewvc/db/derby/docs/branches/10.3/src/getstart/rwwdactivity3.dita?view=diff&rev=549281&r1=549280&r2=549281 ============================================================================== --- db/derby/docs/branches/10.3/src/getstart/rwwdactivity3.dita (original) +++ db/derby/docs/branches/10.3/src/getstart/rwwdactivity3.dita Wed Jun 20 15:30:02 2007 @@ -19,12 +19,12 @@ limitations under the License. --> -The gsEmbedded program -This section describes the gsEmbedded.java program, +The WwdEmbedded program +This section describes the WwdEmbedded.java program, highlighting details specific to accessing a database from a JDBC program. -gsEmbedded.java programcode descriptionorg.apache.derby.jdbc.EmbeddedDriver +WwdEmbedded.java programcode descriptionorg.apache.derby.jdbc.EmbeddedDriver DatabaseshutdownJDBC SQLException @@ -34,15 +34,15 @@ file and follow along in a text viewer or editor. The SECTION NAMES referred to in this section can be found in the comments within the program code and serve as cross-reference points between this section and the Java program. -The program uses methods from the gsUtils class. The utility -class code is not described here but is available for review in the file gsUtils.java. +The program uses methods from the WwdUtils class. The utility +class code is not described here but is available for review in the file WwdUtils.java.
Initialize the program

INITIALIZATION SECTION: The initial lines of code identify the Java packages used in the program, -then set up the Java class gsEmbedded and the main method +then set up the Java class WwdEmbedded and the main method signature. Refer to a Java programming guide for information on these program constructs.

import java.sql.*; -public class gsEmbedded +public class WwdEmbedded { public static void main(String[] args) {
@@ -101,10 +101,10 @@
Set up program to execute SQL

INITIAL SQL SECTION: The program initializes the objects needed to perform subsequent SQL operations and checks to see if the required data table exists.

The -statement object s is initialized. If the utility method gsUtils.gsChk4Table does +statement object s is initialized. If the utility method WwdUtils.wwdChk4Table does not find the WISH_LIST table, the statement object's execute method creates the table by executing the SQL stored in the variable createString.

s = conn.createStatement(); -if (! gsUtils.gsChk4Table(conn)) +if (! WwdUtils.wwdChk4Table(conn)) { System.out.println (" . . . . creating table WISH_LIST"); s.execute(createString); @@ -117,7 +117,7 @@ ("insert into WISH_LIST(WISH_ITEM) values (?)");
Interact with the database

ADD / DISPLAY -RECORD SECTION: This section uses the utility method gsUtils.getWishItem to +RECORD SECTION: This section uses the utility method WwdUtils.getWishItem to gather information from the user. It then uses the objects set up previously to insert the data into the WISH_LIST table and then display all records. A standard do loop causes the program to repeat Modified: db/derby/docs/branches/10.3/src/getstart/twwdactivity3_Setup.dita URL: http://svn.apache.org/viewvc/db/derby/docs/branches/10.3/src/getstart/twwdactivity3_Setup.dita?view=diff&rev=549281&r1=549280&r2=549281 ============================================================================== --- db/derby/docs/branches/10.3/src/getstart/twwdactivity3_Setup.dita (original) +++ db/derby/docs/branches/10.3/src/getstart/twwdactivity3_Setup.dita Wed Jun 20 15:30:02 2007 @@ -23,7 +23,7 @@ This activity loads the database engine using a simple Java JDBC program. -gsEmbedded.java programrunning +WwdEmbedded.java programrunning CLASSPATH environment variable @@ -39,7 +39,7 @@ variable, to locate the binary files (jar files and class files) that are needed to run and other Java applications. Before performing this activity, you need to set -the classpath and compile the gsEmbedded.java program.

+the classpath and compile the WwdEmbedded.java program.

Copy the program files into the DERBYTUTOR directory and set the CLASSPATH environment variable. @@ -65,18 +65,18 @@ at the end of each command so that your current working directory is included in the classpath and the files are copied to the correct location. -Compile the gsEmbedded.java program.javac gsEmbedded.java +Compile the WwdEmbedded.java program.javac WwdEmbedded.java A command prompt appears if the compilation -is successful. The binary file gsEmbedded.class is created. +is successful. The binary file WwdEmbedded.class is created. If an error message appears, verify that the JDK is properly installed. -Run the program.The gsEmbedded.java program populates +Run the program.The WwdEmbedded.java program populates a table with wish-list items. The program prompts you for text input (up to 32 characters), stores the text input in a database table, and then lists the items stored in the table. The program continues to ask for wish-list items until the you type the command exit or a problem is encountered. Some basic information on program progress is displayed at the -beginning and the end of the program. java gsEmbedded +beginning and the end of the program. java WwdEmbedded org.apache.derby.jdbc.EmbeddedDriver loaded. Connected to database jdbcDemoDB . . . . creating table WISH_LIST Modified: db/derby/docs/branches/10.3/src/getstart/twwdactivity4.dita URL: http://svn.apache.org/viewvc/db/derby/docs/branches/10.3/src/getstart/twwdactivity4.dita?view=diff&rev=549281&r1=549280&r2=549281 ============================================================================== --- db/derby/docs/branches/10.3/src/getstart/twwdactivity4.dita (original) +++ db/derby/docs/branches/10.3/src/getstart/twwdactivity4.dita Wed Jun 20 15:30:02 2007 @@ -26,54 +26,54 @@ client/server implementation that uses the Network Server. -gsClient.java programorg.apache.derby.jdbc.ClientDriver +WwdClient.java programorg.apache.derby.jdbc.ClientDriver This activity assumes you have performed the preceding activities and have a working directory called DERBYTUTOR, and have copies of the program files from the $/demo/programs/workingwithderby/ -directory. A basic knowledge of the gsEmbedded.java program +directory. A basic knowledge of the WwdEmbedded.java program and experience starting and connecting to the Network Server are helpful. -You will need to use a text editor to create the gsClient.java +You will need to use a text editor to create the WwdClient.java program. You will create a client -program, gsClient.java, by changing a few lines of the gsEmbedded.java program. +program, WwdClient.java, by changing a few lines of the WwdEmbedded.java program. You can run the client program in multiple command shells, allowing simultaneous update from two or more sources.

You use two command windows (Server-Shell and Client-Shell) in this activity. You use the Server-Shell to start the Network Server and display Network Server messages. You use the Client-Shell to edit, compile and run -the newly created gsClient.java program. You set the CLASSPATH environment +the newly created WwdClient.java program. You set the CLASSPATH environment variable in the Client-Shell to support the client JDBC program.

-Create the gsClient program using the following +Create the WwdClient program using the following steps: Open a command window (Client-Shell). Change to the DERBYTUTOR directory. -Make a copy of the gsEmbedded.java program -called gsClient.java. +Make a copy of the WwdEmbedded.java program +called WwdClient.java. Operating System Command UNIX (Korn Shell) -cp gsEmbedded.java gsClient.java +cp WwdEmbedded.java WwdClient.java Windows -copy gsEmbedded.java gsClient.java +copy WwdEmbedded.java WwdClient.java -Open the gsClient.java file in a text editor +Open the WwdClient.java file in a text editor and update the class name to reflect the new file name:Original declaration - public class gsEmbedded + public class WwdEmbedded New declaration - public class gsClient + public class WwdClient Edit the DEFINE VARIABLES SECTION of the program so that the driver variable contains the name of the "jdbc:derby://localhost:1527/" + dbName + ";create=true";
-Compile the application.javac gsClient.java +Compile the application.javac WwdClient.java A command prompt appears if the compilation -is successful. The binary file gsClient.class is created. +is successful. The binary file WwdClient.class is created. If an error message appears, modify the line indicated so that it is identical to the example. @@ -142,7 +142,7 @@ Include the dot (.) at the end of the command so that your current working directory is included in the classpath. -Run the program: java gsClient +Run the program: java WwdClient org.apache.derby.jdbc.ClientDriver loaded. Connected to database jdbcDemoDB Enter wish-list item (enter exit to end): @@ -207,7 +207,7 @@ command windows and perform the substeps of the "Run the client program" step in each window. Both clients will operate without a problem. In contrast, it would not be possible for a program that uses the embedded driver (for -example, gsEmbedded.java) to access the database until the +example, WwdEmbedded.java) to access the database until the database or the Network Server is shut down.

You may have noticed that the client program does not shut down the database. This is because the database is a shared resource in a client/server environment and, in most cases, should