db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scotsmat...@apache.org
Subject svn commit: r546665 [3/3] - in /db/derby/docs/trunk/src: getstart/ tools/
Date Tue, 12 Jun 2007 23:24:39 GMT
Added: db/derby/docs/trunk/src/getstart/twwdactivity1_overview.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/getstart/twwdactivity1_overview.dita?view=auto&rev=546665
==============================================================================
--- db/derby/docs/trunk/src/getstart/twwdactivity1_overview.dita (added)
+++ db/derby/docs/trunk/src/getstart/twwdactivity1_overview.dita Tue Jun 12 16:24:36 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Arbortext, Inc., 1988-2006, v.4002-->
+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
+ "../dtd/task.dtd">
+<!-- 
+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.
+-->
+<task id="tgsactivity1_overview" xml:lang="en-us">
+<title>Activity 1: Run SQL using the embedded driver</title>
+<shortdesc>In this activity, you will use the embedded driver to load the <ph
+conref="../conrefs.dita#prod/productshortname"></ph> database engine, create
+and connect to a database, and use some basic SQL statements.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm></indexterm></keywords>
+</metadata></prolog>
+<taskbody>
+<context>To run SQL using the embedded driver:</context>
+<steps>
+<step><cmd><xref href="twwdactivity1_Setup.dita#twwdactivity1_Setup">Create
+a directory and copy scripts into the directory</xref></cmd></step>
+<step><cmd><xref href="twwdactivity1.dita#twwdactivity1">Create a Derby
database
+and run SQL statements</xref></cmd></step>
+</steps>
+</taskbody>
+</task>

Propchange: db/derby/docs/trunk/src/getstart/twwdactivity1_overview.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/docs/trunk/src/getstart/twwdactivity2.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/getstart/twwdactivity2.dita?view=auto&rev=546665
==============================================================================
--- db/derby/docs/trunk/src/getstart/twwdactivity2.dita (added)
+++ db/derby/docs/trunk/src/getstart/twwdactivity2.dita Tue Jun 12 16:24:36 2007
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Arbortext, Inc., 1988-2006, v.4002-->
+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
+ "../dtd/task.dtd">
+<!-- 
+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.
+-->
+<task id="tgsactivity2" xml:lang="en-us">
+<title>Activity 2: Run SQL using the client driver</title>
+<shortdesc>This activity uses <ph conref="../conrefs.dita#prod/productshortname"></ph>
within
+a client/server configuration by using the Network Server. The <codeph>ij</codeph>
tool
+is the client application that connects to the <ph conref="../conrefs.dita#prod/productshortname"></ph>
Network
+Server. In this activity, you create a database called <codeph>seconddb</codeph>
and
+run some basic SQL statements.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>Network Server</indexterm><indexterm>Client
driver</indexterm>
+<indexterm>tutorial<indexterm>client driver</indexterm></indexterm></keywords>
+</metadata></prolog>
+<taskbody>
+<prereq>This activity assumes that you know how to open a command shell and
+change to the <codeph>DERBYTUTOR</codeph> directory.  </prereq>
+<context><p>You use two command windows (referred to as Shell-1 and Shell-2)
+in this activity. You use Shell-1 to start the <ph conref="../conrefs.dita#prod/productshortname"></ph>
Network
+Server and display Network Server messages. You use Shell-2 to establish a
+client connection to the Network Server using <codeph>ij</codeph> and then
+perform some basic SQL operations.</p></context>
+<steps>
+<step><cmd>Open a command window (Shell-1) and change to the <codeph>DERBYTUTOR</codeph>
directory.</cmd>
+</step>
+<step><cmd>Start the Network Server.</cmd><stepxmp><simpletable
relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>java -jar $DERBY_HOME/lib/derbyrun.jar
server start</userinput></b>
+<systemoutput>Apache Derby Network Server - 10.2.2.0 - (485682) started and 
+ ready to accept connections on port 1527 at 2007-01-04 20:04:33.511 GMT</systemoutput></codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>java -jar %DERBY_HOME%\lib\derbyrun.jar
server start</userinput></b>
+<systemoutput>Apache Derby Network Server - 10.2.2.0 - (485682) started and 
+ ready to accept connections on port 1527 at 2007-01-04 20:04:33.511 GMT</systemoutput></codeblock></stentry>
+</strow>
+</simpletable></stepxmp><stepresult>A Network Server startup message appears
+in the Shell-1 command  window.</stepresult></step>
+<step><cmd>Open another command window (Shell-2). Change to the <codeph>DERBYTUTOR</codeph>
directory.</cmd>
+</step>
+<step><cmd>Start <codeph>ij</codeph>.</cmd><stepxmp>If
you included the <codeph>DERBY_HOME/bin</codeph> directory
+in your PATH environment variable, type: <codeblock>ij</codeblock> Otherwise,
+you can use the <codeph>java</codeph> command to start the <codeph>ij</codeph>
tool. <simpletable
+relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>java -jar $DERBY_HOME/lib/derbyrun.jar
ij</userinput></b>
+<systemoutput>ij version 10.2</systemoutput></codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>java -jar %DERBY_HOME%\lib\derbyrun.jar
ij</userinput></b>
+<systemoutput>ij version 10.2</systemoutput></codeblock></stentry>
+</strow>
+</simpletable></stepxmp><stepresult>You will enter all subsequent commands
+from the network client, so you will type the commands in the Shell-2 command
+window.</stepresult></step>
+<step><cmd>Create and open a connection to the database using the client driver.</cmd>
+<stepxmp><codeblock><b><userinput>CONNECT 'jdbc:derby://localhost:1527/seconddb;create=true';
+</userinput></b></codeblock><note type="remember">A client connection
URL
+contains a hostname and a port number. For example: <codeph>//localhost:1527/</codeph></note>
</stepxmp>
+</step>
+<step><cmd>Create a table with two columns (ID and NAME) using the following
+SQL statement:</cmd><stepxmp><codeblock><b><userinput>CREATE
TABLE SECONDTABLE
+    (ID INT PRIMARY KEY,
+    NAME VARCHAR(14));</userinput></b>
+<systemoutput>0 rows inserted/updated/deleted
+</systemoutput></codeblock></stepxmp></step>
+<step><cmd>Insert three records into the table.</cmd><stepxmp><codeblock><b><userinput>INSERT
INTO SECONDTABLE VALUES 
+    (100,'ONE HUNDRED'),(200,'TWO HUNDRED'),(300,'THREE HUNDRED');</userinput></b>
+<systemoutput>3 rows inserted/updated/deleted
+</systemoutput></codeblock></stepxmp></step>
+<step><cmd>Select all of the records in the table.</cmd><stepxmp><codeblock><b><userinput>SELECT
* FROM SECONDTABLE;</userinput></b>
+<systemoutput>ID         |NAME
+------------------------
+100        |ONE HUNDRED
+200        |TWO HUNDRED
+300        |THREE HUNDRED
+
+3 rows selected</systemoutput></codeblock></stepxmp></step>
+<step><cmd>Select a subset of records from the table by specifying a <codeph>WHERE</codeph>
clause.</cmd>
+<stepxmp><codeblock><b><userinput>SELECT * FROM SECONDTABLE WHERE
ID=200;</userinput></b>
+<systemoutput>ID         |NAME
+------------------------
+200        |TWO HUNDRED
+
+1 row selected</systemoutput></codeblock></stepxmp></step>
+<step><cmd>Exit <codeph>ij</codeph>.</cmd><stepxmp><codeblock><b><userinput>exit;</userinput></b></codeblock></stepxmp>
+</step>
+<step><cmd>Shut down the  <ph conref="../conrefs.dita#prod/productshortname"></ph>
Network
+Server.</cmd><stepxmp><simpletable relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>java -jar $DERBY_HOME/lib/derbyrun.jar
server shutdown</userinput></b>
+<systemoutput>Apache Derby Network Server - 10.2.2.0 - (485682) shutdown 
+ at 2007-05-04 20:08:44.247 GMT
+</systemoutput></codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>java -jar %DERBY_HOME%\lib\derbyrun.jar
server shutdown</userinput></b>
+<systemoutput>Apache Derby Network Server - 10.2.2.0 - (485682) shutdown 
+ at 2007-05-04 20:08:44.247 GMT
+</systemoutput></codeblock></stentry>
+</strow>
+</simpletable></stepxmp><stepresult>The server shutdown confirmation appears
+in both command windows.</stepresult></step>
+</steps>
+<postreq><b>Activity notes</b> <p>The client connection URL contains
network
+information (hostname and portnumber) not found in the URL for an embedded
+connection. This information tells the client driver the location of the Network
+Server. The client driver sends requests to and receives responses from the
+Network Server.</p><p>In this activity the <ph conref="../conrefs.dita#prod/productshortname"></ph>
database
+engine is embedded in the Network Server and returns data to the  <codeph>ij</codeph>
client
+(a client/server configuration). In contrast, establishing a connection using
+an embedded URL (one without  <codeph>//localhost:1527/</codeph>) would have
+caused the  <ph conref="../conrefs.dita#prod/productshortname"></ph> engine
+to be embedded  in the <codeph>ij</codeph> application (an embedded configuration).</p><p>A
+Network Server startup message is written to the <codeph>derby.log</codeph> file
+along with the standard database engine messages. For example: <codeblock><systemoutput>Apache
Derby Network Server - 10.2.2.0 - (485682) started and ready to 
+ accept connections on port 1527 at 2007-05-04 20:04:33.511 GMT</systemoutput>
+   <i>... Database engine messages not shown ...</i>
+<systemoutput>2007-05-04 20:08:43.883 GMT:
+Shutting down instance c013800d-010f-82e9-fa03-00000011f280</systemoutput></codeblock>
</p><p>In
+this configuration, multiple client programs can connect to the Network Server
+and access the database simultaneously. (This activity does not demonstrate
+this capability.)</p></postreq>
+</taskbody>
+</task>

Propchange: db/derby/docs/trunk/src/getstart/twwdactivity2.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/docs/trunk/src/getstart/twwdactivity3_Setup.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/getstart/twwdactivity3_Setup.dita?view=auto&rev=546665
==============================================================================
--- db/derby/docs/trunk/src/getstart/twwdactivity3_Setup.dita (added)
+++ db/derby/docs/trunk/src/getstart/twwdactivity3_Setup.dita Tue Jun 12 16:24:36 2007
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Arbortext, Inc., 1988-2006, v.4002-->
+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
+ "../dtd/task.dtd">
+<!-- 
+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.
+-->
+<task id="tgsactivity3_Setup" xml:lang="en-us">
+<title>Activity 3: Run a JDBC program using the embedded driver</title>
+<shortdesc>This activity loads the <ph conref="../conrefs.dita#prod/productshortname"></ph>
database
+engine using a simple Java JDBC program. </shortdesc>
+<prolog><metadata>
+<keywords><indexterm>gsEmbedded.java program<indexterm>running</indexterm></indexterm>
+<indexterm>CLASSPATH environment variable</indexterm></keywords>
+</metadata></prolog>
+<taskbody>
+<prereq>This activity assumes that you have opened a command window and navigated
+to the <codeph>DERBYTUTOR</codeph> directory.</prereq>
+<context>JDBC is the Java Database Connectivity API and is also the native
+API for <ph conref="../conrefs.dita#prod/productshortname"></ph>. The program
+uses the embedded driver to create the <codeph>jdbcDemoDB</codeph> database
+(if the database does not exist) and then connect to the database. You can
+then populate a table within the database with text. The program demonstrates
+some basic JDBC processing along with related error handling.  <p>The Java
+compiler and runtime use the classpath, specified by the <codeph>CLASSPATH</codeph>
environment
+variable, to locate the binary files  (jar files and class files) that are
+needed to run  <ph conref="../conrefs.dita#prod/productshortname"></ph> and
+other Java  applications. Before performing this activity, you need to set
+the classpath and compile the <codeph>gsEmbedded.java</codeph> program.</p></context>
+<steps>
+<step><cmd>Copy the program files into the <codeph>DERBYTUTOR</codeph>
directory
+and set the CLASSPATH environment variable.</cmd><stepxmp><simpletable relcolwidth="1*
3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Commands</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>cp $DERBY_HOME/demo/programs/workingwithderby/*
.
+
+export CLASSPATH=$DERBY_HOME/lib/derby.jar:.</userinput></b>
+</codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>copy %DERBY_HOME%\demo\programs\workingwithderby\*
.
+
+set CLASSPATH=%DERBY_HOME%\lib\derby.jar;.</userinput></b>
+</codeblock></stentry>
+</strow>
+</simpletable> <note type="important">Include the dot (<codeph>.</codeph>)
+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. </note></stepxmp>
+</step>
+<step><cmd>Compile the <codeph>gsEmbedded.java</codeph> program.</cmd><stepxmp><codeblock><b><userinput>javac
gsEmbedded.java</userinput></b>
+</codeblock> <note type="important">A command prompt appears if the compilation
+is successful. The binary file <codeph>gsEmbedded.class</codeph> is created.
+If an error message appears, verify that the JDK is properly installed.</note> </stepxmp>
+</step>
+<step><cmd>Run the program.</cmd><info>The <xref href="rwwdactivity3.dita#rwwdactivity3"><codeph>gsEmbedded.java</codeph>
program</xref> 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 <codeph>exit</codeph> or a problem is
+encountered. Some basic information on program progress is displayed at the
+beginning and the end of  the program.</info><stepxmp> <codeblock><b><userinput>java
gsEmbedded</userinput></b>
+<systemoutput>org.apache.derby.jdbc.EmbeddedDriver loaded.
+Connected to database jdbcDemoDB
+ . . . . creating table WISH_LIST
+Enter wish-list item (enter exit to end):</systemoutput>
+<b><userinput>a peppermint stick</userinput></b>
+<systemoutput>  __________________________________________________________
+On 2007-05-04 15:16:16.795 I wished for a peppermint stick
+  __________________________________________________________
+Enter wish-list item (enter exit to end):</systemoutput>
+<b><userinput>an all expenses paid vacation</userinput></b>
+<systemoutput>  __________________________________________________________
+On 2007-05-04 15:16:16.795 I wished for a peppermint stick
+On 2007-05-04 15:16:46.875 I wished for an all expenses paid vacation
+  __________________________________________________________
+Enter wish-list item (enter exit to end):</systemoutput>
+<b><userinput>exit</userinput></b>
+<systemoutput>Closed connection
+Database shut down normally
+Working With Derby JDBC program ending.</systemoutput></codeblock></stepxmp>
+</step>
+</steps>
+</taskbody>
+</task>

Propchange: db/derby/docs/trunk/src/getstart/twwdactivity3_Setup.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/docs/trunk/src/getstart/twwdactivity4.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/getstart/twwdactivity4.dita?view=auto&rev=546665
==============================================================================
--- db/derby/docs/trunk/src/getstart/twwdactivity4.dita (added)
+++ db/derby/docs/trunk/src/getstart/twwdactivity4.dita Tue Jun 12 16:24:36 2007
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Arbortext, Inc., 1988-2006, v.4002-->
+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
+ "../dtd/task.dtd">
+<!-- 
+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.
+-->
+<task id="tgsactivity4" xml:lang="en-us">
+<title>Activity 4: Create and run a JDBC program using the client driver and
+Network Server</title>
+<shortdesc>This activity demonstrates the ease with which a program that embeds <ph
+conref="../conrefs.dita#prod/productshortname"></ph> can be modified for a
+ client/server implementation that uses the  <ph conref="../conrefs.dita#prod/productshortname"></ph>
Network
+Server. </shortdesc>
+<prolog><metadata>
+<keywords><indexterm>gsClient.java program<indexterm>org.apache.derby.jdbc.ClientDriver</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
+<taskbody>
+<prereq>This activity assumes you have performed the preceding activities
+and have a working directory called <codeph>DERBYTUTOR</codeph>, and have
+copies of the program files from the <codeph>$<ph conref="../conrefs.dita#prod/productinstallpath"></ph>/demo/programs/workingwithderby/</codeph>

+directory. A basic knowledge of the <codeph>gsEmbedded.java</codeph> program
+and experience starting and connecting to the Network Server are helpful.
+You will need to use a text editor to create the <codeph>gsClient.java</codeph>

+program.</prereq>
+<context>You will create a <ph conref="../conrefs.dita#prod/productshortname"></ph>
client
+program,  <codeph>gsClient.java</codeph>, by changing a few lines of the  <codeph>gsEmbedded.java</codeph>
program.
+You can run the client program in multiple command shells, allowing simultaneous
+update from two or more sources. <p>You use two command windows (Server-Shell
+and Client-Shell) in this activity. You use the Server-Shell to start the <ph
+conref="../conrefs.dita#prod/productshortname"></ph> Network Server and  display
+Network Server messages. You use the Client-Shell to edit, compile and run
+the newly created <codeph>gsClient.java</codeph> program. You set the  <codeph>CLASSPATH</codeph>
environment
+variable in the Client-Shell to support the client JDBC program.</p></context>
+<steps>
+<step><cmd>Create the <codeph>gsClient</codeph> program using the
following
+ steps:</cmd>
+<substeps>
+<substep><cmd>Open a command window (Client-Shell).</cmd></substep>
+<substep><cmd>Change to the  <codeph>DERBYTUTOR</codeph> directory.</cmd>
+</substep>
+<substep><cmd>Make a copy of the <codeph>gsEmbedded.java</codeph>
program
+called <codeph>gsClient.java</codeph>.</cmd><stepxmp> <simpletable
relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>cp gsEmbedded.java gsClient.java</userinput></b></codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>copy gsEmbedded.java gsClient.java</userinput></b></codeblock></stentry>
+</strow>
+</simpletable> </stepxmp></substep>
+<substep><cmd>Open the <codeph>gsClient.java</codeph> file in a text
editor
+and update the class name to reflect the new file name:</cmd><stepxmp><codeblock><b>Original
declaration</b>
+     public class gsEmbedded
+
+<b>New declaration</b>
+     public class <b>gsClient</b>
+</codeblock></stepxmp></substep>
+<substep><cmd>Edit the <cite>DEFINE VARIABLES SECTION</cite> of the
program
+so that the <codeph>driver</codeph> variable contains the name of the  <ph
+conref="../conrefs.dita#prod/productshortname"></ph> client driver class and
+the <codeph>connectionURL</codeph> variable contains the hostname and port
+number of the Network Server.</cmd><stepxmp><codeblock><b>Original
definitions</b>
+     String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+     String dbName="jdbcDemoDB";
+     String connectionURL = "jdbc:derby:" + dbName + ";create=true";
+
+<b>New definitions</b>
+     String driver = <b>"org.apache.derby.jdbc.ClientDriver"</b>;
+     ...
+     String connectionURL = <b>"jdbc:derby://localhost:1527/"</b> + dbName +
";create=true";
+</codeblock></stepxmp></substep>
+<substep><cmd>Compile the application.</cmd><stepxmp><codeblock><b><userinput>javac
gsClient.java</userinput></b>
+</codeblock> </stepxmp><stepresult>A command prompt appears if the compilation
+is successful. The  binary file <codeph>gsClient.class</codeph> is created.
+If an error message  appears, modify the line indicated so that it is identical
+to the example. </stepresult></substep>
+</substeps>
+</step>
+<step><cmd>Set up the client/server environment using the following steps:</cmd>
+<substeps>
+<substep><cmd>Open a command window (Server-Shell).</cmd></substep>
+<substep><cmd>Change to the <codeph>DERBYTUTOR</codeph>  directory.</cmd>
+</substep>
+<substep><cmd>Start the Network Server:</cmd><stepxmp> <simpletable
relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>java -jar $DERBY_HOME/lib/derbyrun.jar
server start</userinput></b>
+Apache Derby Network Server - 10.2.2.0 - (485682) started and
+ ready to accept connections on port 1527 at 2007-05-04 20:21:28.255 GMT</codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>java -jar %DERBY_HOME%\lib\derbyrun.jar
server start</userinput></b>
+Apache Derby Network Server - 10.2.2.0 - (485682) started and
+ ready to accept connections on port 1527 at 2007-05-04 20:21:28.255 GMT</codeblock></stentry>
+</strow>
+</simpletable> </stepxmp></substep>
+</substeps>
+</step>
+<step><cmd>Run the client program using the following steps:</cmd>
+<substeps>
+<substep><cmd>Return to the Client-Shell window.</cmd></substep>
+<substep><cmd>If not already set, set the <codeph>CLASSPATH</codeph>
environment
+variable to include the  location of the file <codeph>derbyclient.jar</codeph>:</cmd>
+<stepxmp> <simpletable relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>export CLASSPATH=$DERBY_HOME/lib/derbyclient.jar:.</userinput></b></codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>set CLASSPATH=%DERBY_HOME%\lib\derbyclient.jar;.</userinput></b></codeblock></stentry>
+</strow>
+</simpletable> <note type="important">Include the dot (<codeph>.</codeph>)
+at the end of the  command so that your current working directory is included
+in the classpath. </note> </stepxmp></substep>
+<substep><cmd>Run the program:</cmd><stepxmp> <codeblock><b><userinput>java
gsClient</userinput></b>
+<systemoutput>org.apache.derby.jdbc.ClientDriver loaded.
+Connected to database jdbcDemoDB
+Enter wish-list item (enter exit to end):</systemoutput>
+<b><userinput>a sunny day</userinput></b>
+<systemoutput>  __________________________________________________________
+On 2007-05-04 15:16:16.795 I wished for a peppermint stick
+On 2007-05-04 15:16:46.875 I wished for an all expenses paid vacation
+On 2007-05-04 15:24:06.843 I wished for a sunny day
+  __________________________________________________________
+Enter wish-list item (enter exit to end):</systemoutput>
+<b><userinput>a new car</userinput></b>
+<systemoutput>  __________________________________________________________
+On 2007-05-04 15:16:16.795 I wished for a peppermint stick
+On 2007-05-04 15:16:46.875 I wished for an all expenses paid vacation
+On 2007-05-04 15:24:06.843 I wished for a sunny day
+On 2007-05-04 15:25:24.007 I wished for a new car
+  __________________________________________________________
+Enter wish-list item (enter exit to end):</systemoutput>
+<b><userinput>exit</userinput></b>
+<systemoutput>Closed connection
+Working With Derby JDBC program ending.</systemoutput></codeblock> </stepxmp>
+</substep>
+</substeps>
+</step>
+<step><cmd>Shut down the Network Server:</cmd><stepxmp> <simpletable
relcolwidth="1* 3*">
+<sthead>
+<stentry>Operating System</stentry>
+<stentry>Command</stentry>
+</sthead>
+<strow>
+<stentry>UNIX (Korn Shell)</stentry>
+<stentry><codeblock><b><userinput>java -jar $DERBY_HOME/lib/derbyrun.jar
server shutdown</userinput></b>
+<systemoutput>Apache Derby Network Server - 10.2.2.0 - (485682) shutdown 
+ at 2007-05-04 20:27:23.364 GMT</systemoutput>
+</codeblock></stentry>
+</strow>
+<strow>
+<stentry>Windows</stentry>
+<stentry><codeblock><b><userinput>java -jar %DERBY_HOME%\lib\derbyrun.jar
server shutdown</userinput></b>
+<systemoutput>Apache Derby Network Server - 10.2.2.0 - (485682) shutdown 
+ at 2007-05-04 20:27:23.364 GMT</systemoutput>
+</codeblock></stentry>
+</strow>
+</simpletable> </stepxmp><stepresult>The server shutdown confirmation appears
+in both command windows.</stepresult></step>
+</steps>
+<postreq><b>Activity notes</b> <p>In a client/server environment,
the client
+program is often used from other computers on the network. Whenever a system
+accepts connections from other computers, there is a chance of abuse. To maintain
+security, the <ph conref="../conrefs.dita#prod/productshortname"></ph> Network
+Server defaults to accepting connections only from clients running on the
+local  machine (<codeph>localhost</codeph>). Before this or any other  <ph
+conref="../conrefs.dita#prod/productshortname"></ph> client program can access
+the Network Server from another machine, additional steps should be taken
+to secure the Network Server environment. Once secured, the Network Server
+can be safely configured to accept connections from other machines.  Refer
+to the "Network Server security" and "Running the Network Server under the
+security manager" sections of the  <cite><ph conref="../conrefs.dita#pub/citadmin"></ph></cite>
for
+important information on securing the Network Server and enabling network
+connections.</p><p>With the Network Server started, you can run the client
+program simultaneously in multiple windows. To demonstrate this, open two
+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, <codeph>gsEmbedded.java</codeph>) to access the database until the
+database or the Network Server is shut down.</p><p>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
+be shut down only when the Network Server is shut down. If multiple clients
+are accessing the database and one client shuts down the database, the remaining
+clients will encounter a failure the next time they attempt an SQL command.</p><p><ph
+conref="../conrefs.dita#prod/productshortname"></ph>'s two architectures have
+caused confusion for some new  <ph conref="../conrefs.dita#prod/productshortname"></ph>
users,
+who mistakenly  think that embedded is a single-user configuration. This is
+not true. The embedded driver supports multiple simultaneous connections,
+performs locking, and provides performance, integrity, and recoverability.
+Any application that uses the embedded driver can open multiple  <ph conref="../conrefs.dita#prod/productshortname"></ph>
connections
+and then provide a means for multiple users to interact with the database
+on each connection. The <ph conref="../conrefs.dita#prod/productshortname"></ph>
Network
+Server is an example of such an application.</p></postreq>
+</taskbody>
+</task>

Propchange: db/derby/docs/trunk/src/getstart/twwdactivity4.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/docs/trunk/src/tools/derbytools.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/derbytools.ditamap?view=diff&rev=546665&r1=546664&r2=546665
==============================================================================
--- db/derby/docs/trunk/src/tools/derbytools.ditamap (original)
+++ db/derby/docs/trunk/src/tools/derbytools.ditamap Tue Jun 12 16:24:36 2007
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-
+<!--Arbortext, Inc., 1988-2006, v.4002-->
 <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"
  "../dtd/map.dtd">
 <!-- 
@@ -184,6 +184,8 @@
 </topicref>
 <topicref collection-type="family" href="ctoolsij34525.dita" navtitle="Using ij">
 <topicref href="ttoolsij11815.dita" navtitle="Starting ij"></topicref>
+<topicref href="ttoolsijcreatedatabase.dita" navtitle="Creating a database using ij">
+</topicref>
 <topicref href="ttoolsij30600.dita" navtitle="Starting ij using properties">
 </topicref>
 <topicref href="ctoolsij32837.dita" navtitle="Getting started with ij">

Added: db/derby/docs/trunk/src/tools/ttoolsijcreatedatabase.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tools/ttoolsijcreatedatabase.dita?view=auto&rev=546665
==============================================================================
--- db/derby/docs/trunk/src/tools/ttoolsijcreatedatabase.dita (added)
+++ db/derby/docs/trunk/src/tools/ttoolsijcreatedatabase.dita Tue Jun 12 16:24:36 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Arbortext, Inc., 1988-2006, v.4002-->
+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
+ "../dtd/task.dtd">
+<!-- 
+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.
+-->
+<task id="ttoolsijcreatedatabase" xml:lang="en-us">
+<title>Creating a database using <codeph>ij</codeph></title>
+<taskbody>
+<context>You can create a <ph conref="../conrefs.dita#prod/productshortname"></ph>
from
+within the <codeph>ij</codeph> tool.</context>
+<steps>
+<step><cmd>To create a database with the <codeph>ij</codeph> tool,
type the
+following command:</cmd><stepxmp><codeblock>ij> connect 'jdbc:derby:testdb;create=true';</codeblock></stepxmp>
+<stepresult>This command creates a database called <codeph>testdb</codeph>
in
+the current directory, populates the system tables, and connects to the database.
+You can then run any SQL statements from the <codeph>ij</codeph> command line.</stepresult>
+</step>
+</steps>
+</taskbody>
+</task>

Propchange: db/derby/docs/trunk/src/tools/ttoolsijcreatedatabase.dita
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message