background image
<< Create a table with two columns using standard SQL | Command to start the ij tool >>
<< Create a table with two columns using standard SQL | Command to start the ij tool >>

Run SQL using the client driver

Getting Started with Derby
25
You should be returned to the
DERBYTUTOR
directory.
9. Browse the most important files created by this activity:
· The
derby.log
file. This file is a message and error log that, under normal
circumstances, contains a set of startup messages and a shutdown message.
----------------------------------------------------------------
Wed Mar 02 17:06:58 EST 2011:
Booting Derby version The Apache Software Foundation - Apache
Derby - 10.8.0.0 - (1076370):
instance a816c00e-012e-789c-116d-000000bbdd88
on database directory C:\DERBYTUTOR\firstdb
with class loader sun.misc.Launcher$AppClassLoader@11b86e7
Loaded from file:C:\db-derby-10.8.0.0-bin\lib\derby.jar
java.vendor=Sun Microsystems Inc.
java.runtime.version=1.6.0_24-b07
user.dir=C:\DERBYTUTOR
derby.system.home=C:\DERBYTUTOR
Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
Wed Mar 02 17:08:36 EST 2011: Shutting down Derby engine
----------------------------------------------------------------
Wed Mar 02 17:08:36 EST 2011:
Shutting down instance a816c00e-012e-789c-116d-000000bbdd88 on
database directory C:\DERBYTUTOR\firstdb
with class loader sun.misc.Launcher$AppClassLoader@11b86e7
----------------------------------------------------------------
· The
firstdb
database directory. Within the directory are the subdirectories
seg0
(containing the data files) and
log
(containing the transaction log files).
Activity 2: Run SQL using the client driver
This activity uses Derby within a client/server configuration by using the Network Server.
The
ij
tool is the client application that connects to the Derby Network Server. In this
activity, you create a database called
seconddb
and run some basic SQL statements.
This activity assumes that you know how to open a command shell and change to the
DERBYTUTOR
directory.
You use two command windows (referred to as Shell-1 and Shell-2) in this activity. You
use Shell-1 to start the Derby Network Server and display Network Server messages.
You use Shell-2 to establish a client connection to the Network Server using
ij
and then
perform some basic SQL operations.
1. Open a command window (Shell-1) and change to the
DERBYTUTOR
directory.
2. Start the Network Server, as shown in the following table.
Table 14.
Command to start the Network Server
Operating
System
Command
UNIX (Korn Shell)
java -jar $DERBY_HOME/lib/derbyrun.jar server
start
Wed Mar 02 17:25:26 EST 2011 : Security manager
installed using the Basic server security policy.
Wed Mar 02 17:25:27 EST 2011 : Apache Derby
Network Server - 10.8.0.0 - (1076370) started and
ready to accept connections on port 1527
Windows
java -jar %DERBY_HOME%\lib\derbyrun.jar server
start
Wed Mar 02 17:25:26 EST 2011 : Security manager
installed using the Basic server security policy.
Wed Mar 02 17:25:27 EST 2011 : Apache Derby