Java Reference
In-Depth Information
Note
The embedded and client/server environment setup scripts refer to a
DERBY_INSTALL
environment variable. According to the “Re: DERBY_INSTALL
and DERBY_HOME” mail item (
http://www.mail-archive.com/derby-
places
DERBY_INSTALL
for consistency with other Apache projects.
Youmustalsosetthe
CLASSPATH
environmentvariable.Theeasiestwaytosetthis
environmentvariableistorunascriptfileincludedwithJavaDB.WindowsandUnix/
Linuxversionsofvarious“
set
xxx
CP
”scriptfiles(whichextendthecurrentclasspath)
arelocatedinthe
%JAVA_HOME%\db
\
bin
directory.Thescriptfile(s)torunwillde-
pend on whether you work with the embedded or client/server environment:
• For the embedded environment, invoke
setEmbeddedCP
to add
derby.jar
and
derbytools.jar
to the classpath.
• For the client/server environment, invoke
setNetworkServerCP
to add
derbynet.jar
and
derbytools.jar
totheclasspath.Inaseparatecom-
mandwindow,invoke
setNetworkClientCP
toadd
derbyclient.jar
and
derbytools.jar
to the classpath.
Caution
There'saproblemwiththeWindows
setEmbeddedCP.bat
,
setNet-
workClientCP.bat
, and
setNetworkServerCP.bat
files. Each file's
@FOR
%%X in ("%DERBY_HOME%") DO SET DERBY_HOME=%%~sX
line screws
upthe
CLASSPATH
environmentvariable—Ithinktheproblem'srelatedto
~sX
.I've
foundthatcommentingoutthisline(byprefixingthelinewith
rem
andaspace)solves
the problem.
Java DB Demos
The
%JAVA_HOME%\demo\db\programs
directory contains HTML documenta-
tionthatdescribesthedemosincludedwithJavaDB;the
demo.html
fileistheentry
point into this documentation. These demos include a simple JDBC application for
workingwithJavaDB,anetworkserversampleprogram,andsampleprogramsthatare
introduced in the
Working with Derby
manual.
Note
The
Working with Derby
manualunderscoresJavaDB'sDerbyheritage.You
can download this manual and other Derby manuals from the documentation sec-