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