Using ij
Derby Tools and Utilities Guide
15
Using ij
ij is Derby's interactive JDBC scripting tool. It is a simple utility for running scripts or
interactive queries against a Derby database.
ij is a Java application, which you start from a command window such as an MS-DOS
Command Window or the UNIX shell. ij provides several non-SQL commands for ease in
accessing a variety of JDBC features for testing.
Starting ij
Derby provides batch and shell scripts for users in Windows and UNIX environments
that can be used to start ij. By calling the appropriate script you will start ij and be able to
connect with a simple command. The scripts are found in the
bin
directory of your Derby
installation. You can also customize the ij scripts to suit your environment.
If you are using Derby as a client/server environment, start the Network Server before
connecting to the Derby database. (See "Starting the Network Server" in the Derby
Server and Administration Guide for details.) You can start ij by running the ij scripts for
your environment. Follow the instructions in "Setting up your environment" in Getting
Started with Derby to set the
DERBY_HOME
and
JAVA_HOME
environment variables and
to add
DERBY_HOME/bin
to your path. Then use the following command:
ij [-p propertyFile] [inputFile]
Alternatively, set the
DERBY_HOME
environment variable, then use one of these
commands:
(UNIX) java [options] -jar $DERBY_HOME/lib/derbyrun.jar ij
[-p propertyFile] [inputFile]
(Windows) java [options] -jar %DERBY_HOME%\lib\derbyrun.jar ij
[-p propertyFile] [inputFile]
java [options] org.apache.derby.tools.ij
[-p propertyFile] [inputFile]
If you use the last form of the command, be sure that
derbyrun.jar
is in your
classpath (for pre-10.2 distributions
derbytools.jar
and usually
derby.jar
were
required in the classpath).
If you need to use other classes in addition to
derbyrun.jar
, you cannot use the
-cp
argument or the CLASSPATH environment variable to set CLASSPATH variables when
you are using the
-jar
argument to start the
ij
tool. If you want to run the
ij
tool with a
custom classpath, you cannot use the
-jar
argument. Instead, you have to use the full
class name to start the
ij
tool (
java org.apache.derby.tools.ij
).
The command line items are:
·
java
Start the JVM.
·
options
The options that the JVM uses. You can use the -D option to set ij properties (see
) or system properties, such as Derby properties.
·
propertyFile