InstantDB - Installation Instructions


Home Top Next Prev

Please email any bug reports, comments or suggestions to:

peter.hearty@ceasar.demon.co.uk


To install InstantDB follow these steps:

  1. Make sure you have Sun's JDBC driver manager installed. For information on installing JDBC see Sun's web-site at http://java.sun.com. Note that JDBC is already included in JDK versions 1.1 and later.
  2. Create a new directory on your machine.
  3. Download the zip archive: idbx_x.zip, and place it in the newly created directory. "x_x" will usually be the latest version.
  4. Unzip the archive. Be careful to use a version of unzip that allows long filenames and that will re-create the full directory structure.

You should now have the following sub-directories:

Classes/dbthis holds the database classes
Classes/jdbcthe jdbc driver implementation classes
Doca copy of this web site
Sampleholds the sample files
Examplesholds other example files
JDBCApplApplet that can access InstantDB
TrigExplExample of InstantDB triggers

Add the Classes sub-directory to your CLASSPATH (or use the Tools/Options menu, Directories Tab if you're using Visual J++).

Change to the Sample sub-directory and enter the command:

java -ms2m -mx4m sample

If all goes well, Sample will create further sub-directories and create database tables in those sub-directories. You will also see some output on the screen. This is due to the fact that the supplied properties file enables a certain amount of logging. This can be easily switched off by editing the sample.prp file and setting traceLevel to zero.

If you were paying very close attention to the output, you may have spotted the URL "jdbc:idb=sample.prp". InstantDB refers to a database via a Java properties file. The properties file defines everything that InstantDB needs to know in order to create or open the database. Even the name of the database is derived from the properties file.

There is no seperate database creation utility. If the properties file directs InstantDB to a database that does not exist, InstantDB creates the database itself.

The sample.prp file contains comments on the available configuration options. Those that are not self-explanatory are discussed later.

The sample program takes its SQL from three files called sql1.txt, sql2.txt and sql3.txt in the sample sub-directory. This includes examples of most (but not all) of the SQL syntax supported by InstantDB. Full details of the sample program are given in the examples section.

The test program also includes a test import file: "import1.txt". The format of this file is found in import_schema.txt. More information on importing tables is described later.

Directory Locations

The properties file which defines the database, contains information about the location of various database files. These are specified using the following properties.

Property ReqdHolds
tablePath Y Ordinary database tables
tmpPath N Temporary tables such as Results sets
systemPathN System tables, such as the table of all columns
indexPath N Index tables
syntaxPathY File containing the allowed syntax

If tmpPath, systemPath and indexPath are not specified then they default to the same value as tablePath.

Paths can be specified as either absolute paths, or as relative paths. If relative paths are used, then the paths are relative to the current user directory as specified in the system property user.dir. This is usually the directory that the Java Virtual Machine is being run in (i.e. the directory you were in when you typed the "java" command). Note that changing user.dir does not change the user's current directory, it simply changes the property. There is currently no way to change the user directory in Java.

Paths relative to the properties file itself, rather than to the current user directory, are also supported. To enable this option, include the line:

relativeToProperties=1
in the properties file. Note that both absolute and relative paths can be specified using either forward slashes / or double backslashes \\ on Windows 95 and NT. Using relative paths with forward slashes provides the highest degree of portability. This applies to the syntaxPath as well as to the various table paths.

The sample.prp file provided in the sample directory uses paths that are relative to itself.

Paths can also be specified using system properties. This is done by prefixing the path value with a '$' dollar sign. For example, setting tablePath=$user.dir will cause tabelPath to be set to the runtime value of the System property "user.dir".

Windows/OS2 users

When table paths are specified relative to the properties file, make sure you pass a url that contains the full path of the properties file. e.g. jdbc:idb:c:\idb\sample.prp (double back-slashes if in Java code).

A url such as jdbc:idb:sample.prp will work fine when you are actually running your program from the directory containing sample.prp, but you must use the full path of the properties file if you are running the program from a different directory.

Apple MAC users

The current example text files are saved with CR/LF line terminators. You may have to convert some of these files to use standard MAC line terminators (LF only) to get the sample programs to work.

This applies to the sqlsyntax file as well.

My thanks to David Bowser-Chao for pointing this out.


Home Top Next Prev