Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 96219 invoked from network); 3 Jan 2007 23:44:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jan 2007 23:44:47 -0000 Received: (qmail 61979 invoked by uid 500); 3 Jan 2007 23:44:54 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 61912 invoked by uid 500); 3 Jan 2007 23:44:54 -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 61901 invoked by uid 99); 3 Jan 2007 23:44:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2007 15:44:54 -0800 X-ASF-Spam-Status: No, hits=-9.4 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, 03 Jan 2007 15:43:46 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 1D6E31A981F; Wed, 3 Jan 2007 15:42:35 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r492351 - in /db/derby/docs/trunk/src/workingwithderby: rwwdactivity3.dita twwdIntro.dita twwdactivity1.dita twwdactivity1_Setup.dita twwdactivity2.dita twwdactivity3_Setup.dita twwdactivity4.dita Date: Wed, 03 Jan 2007 23:42:34 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070103234235.1D6E31A981F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kristwaa Date: Wed Jan 3 15:42:34 2007 New Revision: 492351 URL: http://svn.apache.org/viewvc?view=rev&rev=492351 Log: DERBY-2194: Backed out r492086 (patch 'DERBY-2194.diff'), which was prematurely committed. Modified: db/derby/docs/trunk/src/workingwithderby/rwwdactivity3.dita db/derby/docs/trunk/src/workingwithderby/twwdIntro.dita db/derby/docs/trunk/src/workingwithderby/twwdactivity1.dita db/derby/docs/trunk/src/workingwithderby/twwdactivity1_Setup.dita db/derby/docs/trunk/src/workingwithderby/twwdactivity2.dita db/derby/docs/trunk/src/workingwithderby/twwdactivity3_Setup.dita db/derby/docs/trunk/src/workingwithderby/twwdactivity4.dita Modified: db/derby/docs/trunk/src/workingwithderby/rwwdactivity3.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/rwwdactivity3.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/rwwdactivity3.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/rwwdactivity3.dita Wed Jan 3 15:42:34 2007 @@ -44,7 +44,6 @@ Refer to a Java programming guide for information on these program constructs.

import java.sql.*; - public class WwdEmbedded { public static void main(String[] args) @@ -81,11 +80,10 @@ String driver = "org.apache.derby.jdbc.EmbeddedDriver"; String dbName="jdbcDemoDB"; String connectionURL = "jdbc:derby:" + dbName + ";create=true"; -... String createString = "CREATE TABLE WISH_LIST " - + "(WISH_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY " - ... - + " WISH_ITEM VARCHAR(32) NOT NULL) " ; + + "(WISH_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY " + ... + + " WISH_ITEM VARCHAR(32) NOT NULL) " ;
Start the <ph conref="wwdconrefs.dita#prod/productshortname"></ph> engine

LOAD DRIVER SECTION: Loading the @@ -96,10 +94,10 @@ is usually due to an incorrect classpath setting.

String driver = "org.apache.derby.jdbc.EmbeddedDriver"; ... -try { +try{ Class.forName(driver); } catch(java.lang.ClassNotFoundException e) { - ... +... }
Boot the database

BOOT DATABASE SECTION: The DriverManager class @@ -114,9 +112,9 @@ ... try { conn = DriverManager.getConnection(connectionURL); - ... <most of the program code is contained here> +... <most of the program code is contained here> } catch (Throwable e) { - ... +... }

Set up program to execute SQL

INITIAL SQL SECTION: The program initializes the objects needed @@ -200,7 +198,7 @@ } } if (!gotSQLExc) { - System.out.println("Database did not shut down normally"); + System.out.println("Database did not shut down normally"); } else { System.out.println("Database shut down normally"); } @@ -221,7 +219,7 @@ // Beginning of the primary catch block: uses errorPrint method } catch (Throwable e) { /* Catch all exceptions and pass them to - ** the exception reporting method */ + ** the exception reporting method */ System.out.println(" . . . exception thrown:"); errorPrint(e); } Modified: db/derby/docs/trunk/src/workingwithderby/twwdIntro.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/twwdIntro.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/twwdIntro.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/twwdIntro.dita Wed Jan 3 15:42:34 2007 @@ -105,40 +105,6 @@ outputs vendor-specific information. If the command produces an error or the version listed is not 1.3 or higher, install a JDK before continuing. -Set the - -environment variable. - -The -variable defines the file system path to the root directory of the - installation. -

-The example commands defining - use -the fictitious file system paths C:\derby for Windows examples -and /opt/derby for UNIX examples. Be sure to adjust these -commands so that - -indicates the location of the - installation on the -system you are using. -

- - - -Operating System -Command - - -Windows -set DERBY_HOME=C:\derby - - -UNIX (Korn Shell) -export DERBY_HOME=/opt/derby - - - Verify that the environment variable is set and points to the root directory of the Modified: db/derby/docs/trunk/src/workingwithderby/twwdactivity1.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/twwdactivity1.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/twwdactivity1.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/twwdactivity1.dita Wed Jan 3 15:42:34 2007 @@ -40,9 +40,8 @@ -Run the - ij -tool. +Run the +ij tool. Operating System @@ -51,11 +50,13 @@ Windows java -jar %DERBY_HOME%\lib\derbyrun.jar ij + ij version 10.2 UNIX (Korn Shell) java -jar $DERBY_HOME/lib/derbyrun.jar ij + ij version 10.2 @@ -74,8 +75,7 @@
connect
The ij command to establish a connection to a database. The connection URL -is enclosed in single quotation marks. An ij command can -be in either uppercase or lowercase.
+is enclosed in single quotation marks.
jdbc:derby:
@@ -109,36 +109,38 @@ CREATE TABLE FIRSTTABLE (ID INT PRIMARY KEY, NAME VARCHAR(12)); + 0 rows inserted/updated/deleted
Insert three records.INSERT INTO FIRSTTABLE VALUES (10,'TEN'),(20,'TWENTY'),(30,'THIRTY'); + 3 rows inserted/updated/deleted Perform a simple select of all records in the table. SELECT * FROM FIRSTTABLE; -ID |NAME ------------------------- -10 |TEN -20 |TWENTY -30 |THIRTY + + ID |NAME + ------------------------ + 10 |TEN + 20 |TWENTY + 30 |THIRTY 3 rows selected Perform a qualified select of the record with column ID=20. SELECT * FROM FIRSTTABLE WHERE ID=20; -ID |NAME ------------------------- -20 |TWENTY + + ID |NAME + ------------------------ + 20 |TWENTY 1 row selected Load the SQL script ToursDB_schema.sql to create the tables and other schema objects (this step is optional). run 'ToursDB_schema.sql'; -ij> ... -CREATE TABLE AIRLINES - ( - AIRLINE CHAR(2) NOT NULL , +ij> CREATE TABLE AIRLINES + ( AIRLINE CHAR(2) NOT NULL , AIRLINE_FULL VARCHAR(24), BASIC_RATE DOUBLE PRECISION, ... @@ -172,8 +174,7 @@ Booting Derby version The Apache Software Foundation - Apache Derby - version - (tag): instance c013800d-0109-7f82-e11f-000000119a68 - on database directory C:\DERBYDBS\firstdb - + on database directory C:\DERBYDBS\FIRSTDB Database Class Loader started - derby.database.classpath='' date 23:44:13.178 GMT: Modified: db/derby/docs/trunk/src/workingwithderby/twwdactivity1_Setup.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/twwdactivity1_Setup.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/twwdactivity1_Setup.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/twwdactivity1_Setup.dita Wed Jan 3 15:42:34 2007 @@ -31,17 +31,48 @@ -In preparation for performing this activity, you must have set the -environment variables JAVA_HOME and -, as -described in . +In preparation for performing this activity, you must set the +environment variable + and +create an empty working directory, DERBYDBS. The + +variable defines the file system path to the root directory of the + installation. The +DERBYDBS directory is where the files created during the +activities are stored. - +The example commands defining + use +the fictitious file system paths C:\derby for Windows examples +and /opt/derby for UNIX examples. Be sure to adjust these +commands so that + +indicates the location of the + installation on the +system you are using. A command prompt appears after each command is executed. If an error appears, verify the spelling and retype the command. +Set the + +environment variable. + + +Operating System +Command + + +Windows +set DERBY_HOME=C:\derby + + +UNIX (Korn Shell) +export DERBY_HOME=/opt/derby + + + Create the DERBYDBS work directory. @@ -57,8 +88,6 @@ mkdir DERBYDBS -The DERBYDBS directory is where the files created -during the activities are stored. Change the directory (cd) to the work directory. Modified: db/derby/docs/trunk/src/workingwithderby/twwdactivity2.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/twwdactivity2.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/twwdactivity2.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/twwdactivity2.dita Wed Jan 3 15:42:34 2007 @@ -57,6 +57,7 @@ Windows java -jar %DERBY_HOME%\lib\derbynet.jar start + Apache Derby Network Server - version - (tag) started and ready to accept connections on port 1527 at date 00:08:30.049 GMT @@ -64,6 +65,7 @@ UNIX (Korn Shell) java -jar $DERBY_HOME/lib/derbynet.jar start + Apache Derby Network Server - version - (tag) started and ready to accept connections on port 1527 at date 00:08:30.049 GMT @@ -84,11 +86,13 @@ Windows java -jar %DERBY_HOME%\lib\derbyrun.jar ij + ij version 10.2 UNIX (Korn Shell) java -jar $DERBY_HOME/lib/derbyrun.jar ij + ij version 10.2 @@ -105,28 +109,32 @@ CREATE TABLE SECONDTABLE (ID INT PRIMARY KEY, NAME VARCHAR(14)); + 0 rows inserted/updated/deleted Insert three records into the table. INSERT INTO SECONDTABLE VALUES (100,'ONE HUNDRED'),(200,'TWO HUNDRED'),(300,'THREE HUNDRED'); + 3 rows inserted/updated/deleted Select all of the records in the table. SELECT * FROM SECONDTABLE; -ID |NAME ------------------------- -100 |ONE HUNDRED -200 |TWO HUNDRED -300 |THREE HUNDRED + + ID |NAME + ------------------------ + 100 |ONE HUNDRED + 200 |TWO HUNDRED + 300 |THREE HUNDRED 3 rows selected Select a subset of records from the table by specifying a WHERE clause. SELECT * FROM SECONDTABLE WHERE ID=200; -ID |NAME ------------------------- -200 |TWO HUNDRED + + ID |NAME + ------------------------ + 200 |TWO HUNDRED 1 row selected Exit ij. @@ -142,6 +150,7 @@ Windows java -jar %DERBY_HOME%\lib\derbynet.jar shutdown + Apache Derby Network Server - version - (tag) shutdown at date 00:16:44.223 GMT @@ -149,6 +158,7 @@ UNIX (Korn Shell) java -jar $DERBY_HOME/lib/derbynet.jar shutdown + Apache Derby Network Server - version - (tag) shutdown at date 00:16:44.223 GMT @@ -169,14 +179,14 @@ //localhost:1527/) would have caused the engine to be embedded in the ij application (an embedded configuration).

-

A Network Server startup message is written to the +

Network Server startup and shutdown messages are written to the derby.log log file along with the standard database engine messages. For example: Apache Derby Network Server - version - (tag) started and ready to accept connections on port 1527 at date 00:08:30.049 GMT ... Database engine messages not shown ... -date 00:16:44.223 GMT: -Shutting down instance c013800d-010f-82e9-fa03-00000011f280 +Apache Derby Network Server - version - (tag) shutdown + at date 00:16:44.223 GMT

In this configuration, multiple client programs can connect to the Network Server and access the database simultaneously. (This example does not Modified: db/derby/docs/trunk/src/workingwithderby/twwdactivity3_Setup.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/twwdactivity3_Setup.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/twwdactivity3_Setup.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/twwdactivity3_Setup.dita Wed Jan 3 15:42:34 2007 @@ -78,32 +78,39 @@ an error message appears, verify that the JDK is properly installed. Run the program. -The WwdEmbedded.java program populates a table with +

The WwdEmbedded.java program populates a table with wish-list items. It prompts the user 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 user types 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. +the program.

java WwdEmbedded -org.apache.derby.jdbc.EmbeddedDriver loaded. + +org.apache.derby.jdbc.EmbeddedDriver loaded. Connected to database jdbcDemoDB . . . . creating table WISH_LIST + Enter wish-list item (enter exit to end): a peppermint stick - __________________________________________________________ + +__________________________________________________________ On date 15:11:50.412 I wished for a peppermint stick - __________________________________________________________ +__________________________________________________________ + Enter wish-list item (enter exit to end): an all expenses paid vacation - __________________________________________________________ + +__________________________________________________________ On date 15:11:50.412 I wished for a peppermint stick On date 15:12:47.024 I wished for an all expenses paid vacation - __________________________________________________________ +__________________________________________________________ + Enter wish-list item (enter exit to end): exit -Closed connection + +Closed connection Database shut down normally Working With Derby JDBC program ending.
Modified: db/derby/docs/trunk/src/workingwithderby/twwdactivity4.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/workingwithderby/twwdactivity4.dita?view=diff&rev=492351&r1=492350&r2=492351 ============================================================================== --- db/derby/docs/trunk/src/workingwithderby/twwdactivity4.dita (original) +++ db/derby/docs/trunk/src/workingwithderby/twwdactivity4.dita Wed Jan 3 15:42:34 2007 @@ -140,6 +140,7 @@ Windows java -jar %DERBY_HOME%\lib\derbynet.jar start + Apache Derby Network Server - version - (tag) started and ready to accept connections on port 1527 at date 00:56:33.091 GMT @@ -147,6 +148,7 @@ UNIX (Korn Shell) java -jar $DERBY_HOME/lib/derbynet.jar start + Apache Derby Network Server - version - (tag) started and ready to accept connections on port 1527 at date 00:56:33.091 GMT @@ -192,23 +194,29 @@ Run the program: java WwdClient -org.apache.derby.jdbc.ClientDriver loaded. + +org.apache.derby.jdbc.ClientDriver loaded. Connected to database jdbcDemoDB + Enter wish-list item (enter exit to end): a sunny day - __________________________________________________________ + +__________________________________________________________ On date 15:11:50.412 I wished for a peppermint stick On date 15:12:47.024 I wished for an all expenses paid vacation On date 10:08:21.167 I wished for a sunny day - __________________________________________________________ +__________________________________________________________ + Enter wish-list item (enter exit to end): a new car - __________________________________________________________ + +__________________________________________________________ On date 15:11:50.412 I wished for a peppermint stick On date 15:12:47.024 I wished for an all expenses paid vacation On date 10:08:21.167 I wished for a sunny day On date 10:08:33.665 I wished for a new car - __________________________________________________________ +__________________________________________________________ + Enter wish-list item (enter exit to end): exit @@ -228,6 +236,7 @@ Windows java -jar %DERBY_HOME%\lib\derbynet.jar shutdown + Apache Derby Network Server - version - (tag) shutdown at date 19:13:51.445 GMT @@ -235,6 +244,7 @@ UNIX (Korn Shell) java -jar $DERBY_HOME/lib/derbynet.jar shutdown + Apache Derby Network Server - version - (tag) shutdown at date 19:13:51.445 GMT