Command to set the CLASSPATH environment variable
Getting Started with Derby
34
Operating
System
Command
Wed Mar 02 17:45:31 EST 2011 : Security
manager installed using the Basic server
security policy.
Wed Mar 02 17:45:32 EST 2011 : Apache Derby
Network Server - 10.8.0.0 - (1076370) started
and ready to accept connections on port 1527
3. Run the client program using the following steps:
a. Return to the Client-Shell window.
b. Set the
CLASSPATH
environment variable to include the location of the file
derbyclient.jar
(not
derby.jar
as in the embedded example), as
shown in the following table.
Table 20.
Command to set the
CLASSPATH
environment variable
Operating
System
Command
UNIX (Korn
Shell)
export
CLASSPATH=$DERBY_HOME/lib/derbyclient.jar:.
Windows
set
CLASSPATH=%DERBY_HOME%\lib\derbyclient.jar;.
> Important: Include the dot (
.
) at the end of the command so that your
current working directory is included in the classpath.
c. Run the program:
java WwdClient
org.apache.derby.jdbc.ClientDriver loaded.
Connected to database jdbcDemoDB
Enter wish-list item (enter exit to end):
a sunny day
__________________________________________________
On 2011-03-02 17:41:52.531 I wished for a peppermint stick
On 2011-03-02 17:42:03.248 I wished for a long vacation
On 2011-03-02 17:48:09.622 I wished for a sunny day
__________________________________________________
Enter wish-list item (enter exit to end):
a new car
__________________________________________________
On 2011-03-02 17:41:52.531 I wished for a peppermint stick
On 2011-03-02 17:42:03.248 I wished for a long vacation
On 2011-03-02 17:48:09.622 I wished for a sunny day
On 2011-03-02 17:48:29.136 I wished for a new car
__________________________________________________
Enter wish-list item (enter exit to end):
exit
Closed connection
Getting Started With Derby JDBC program ending.
4. Shut down the Network Server, as shown in the following table.
Table 21.
Command to shut down the Network Server
Operating
System
Command
UNIX (Korn Shell)
java -jar $DERBY_HOME/lib/derbyrun.jar server
shutdown
Wed Mar 02 17:48:54 EST 2011 : Apache Derby
Network Server - 10.8.0.0 - (1076370) shutdown
Windows