This readme provides brief instructions for installing the pljava support
shipped with the postgresql for os/2 installation.

The PLJava support shipped is already compiled. If you want the source code
for the programs they are available at 

http://gborg.postgresql.org/project/pljava/projdisplay.php

NOTE - the pljava support is only known to work with the Golden Code
native OS/2 java kit. The Innotek Java SDK will not work because the
java JVM is not a native OS/2 DLL and cannot be loaded by the postgresql
database engine. You may use the Innotek Java SDK for client Java applications.


PLJava support files
\pgsql\bin\java_settings.cmd
\pgsql\lib\pljava.dll
\pgsql\lib\pljava.lib - not used by postgresql
\pgsql\lib\pljava.def - not used by postgresql
\pgsql\lib\libpljava.a - not used by postgresql
\pgsql\pljava\deploy.jar
\pgsql\pljava\pljava.jar
\pgsql\pljava\examples.jar
\pgsql\pljava\test.jar
\pgsql\pljava\jni\*.h - not used by postgresql
\pgsql\pljava\sql\install.sql
\pgsql\pljava\sql\uninstall.sql
\pgsql\doc\pljava\intro.html
\pgsql\doc\pljava\jni_rationale.html
\pgsql\doc\pljava\pljava_and_posgresql_8.html
\pgsql\doc\pljava\readme.html
\pgsql\doc\pljava\solutions.html
\pgsql\doc\pljava\userguide.html

JDBC Drivers
These files are provided for use with Java client applications
\pgsql\jdbc\postgresql-8.0-310.jdbc2.jar
\pgsql\jdbc\postgresql-8.0-310.jdbc2ee.jar
\pgsql\jdbc\postgresql-8.0-310.jdbc3.jar

The file postgresql-8.0-310.jdbc3.jar is the driver to use with the 
Golden Code 1.4.x Java SDK. More information about the postgreSQL
JDBC drivers can be found at http://jdbc.postgresql.org/


For more information on PLJava please consult the documentation files
in the \pgsql\doc\pljava directory

An outline of the setup requirements can be found in the \pgsql\doc\pljava\readme.html file.


To install PLJava support do the following:

1) a java_settings.cmd in \pgsql\bin should be edited to set java_home to
   the root directory of your Golden Code 1.4.x java installation. 
   If the location of the Java install is already present in your LIBPATH and PATH
   you do need to do this.

2) the postgresql.conf file in the database directory has to edited to include
   the settings for PLJava Add the following two lines to the end of the 
   postgresql.conf file

pljava.classpath = '/pgsql/pljava/pljava.jar'
custom_variable_classes = 'pljava'



3) If required - execute the java_setting.cmd command file before starting postgresql.
4) start the database server
5) execute the following command to install the pljava support substituting the
   name of your database for "database-name"

psql -U postgres -d database-name < \pgsql\pljava\sql\install.sql


That completes the set up for PLJava support.


The following steps will run the PLJava test application

NOTE - you should have an empty CLASSPATH environment variable for this.

1) start psql and attach to your database

psql -U postgres -d database-name

2) execute the following commands in psql

SELECT sqlj.install_jar('file:///pgsql/pljava/examples.jar', 'samples',  true);
SELECT sqlj.set_classpath('javatest', 'samples');

3) execute the test application with the following command

java -cp \pgsql\jdbc\postgresql-8.0-310.jdbc3.jar;\pgsql\pljava\test.jar org.postgresql.pljava.test.Tester -user postgres -database database-name

The program will display a number of messages while it executes....

