Install PLJava:
Download PLJava from
http://gborg.postgresql.org/project/pljava/genpage.php?downloads
Compile PLJava:
You must set Java & PostgreSQL variables in PATH, example:
export PATH=$PATH:/app/java/j2sdk1.4.2_07/bin:/usr/local/pgsql/bin
/app/postgresql/org.postgresql.pljava#make
/app/postgresql/org.postgresql.pljava#make install
Add parameters to your file /usr/local/pgsql/data/postgresql.conf , example:
# define "pljava" as a custom variable class. This is a comma separated
# list of names.
#
custom_variable_classes = 'pljava'
# define the class path that the JVM will use when loading the
# initial library. Only meaningful for non GJC installations
#
pljava.classpath = '/app/postgresql/org.postgresql.pljava/build/pljava.jar'
# Set the size of the prepared statement MRU cache
#
#pljava.statement_cache_size = 10
# If true, lingering savepoints will be released on function exit. If false,
# the will be rolled back
#
pljava.release_lingering_savepoints = true
# Define startup options for the Java VM.
#
pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48'
# Setting debug to true will cause the postgres process to go
# into a sleep(1) loop on its first call to java. This is
# only useful if you want to debug the PLJava internal C code.
#
pljava.debug = false
Install PLJava into Database:
java -cp /app/postgresql/org.postgresql.pljava/build/deploy.jar:/app/postgresql/postgresql-8.0-310.jdbc3.jar org.postgresql.pljava.deploy.Deployer -install -user compiere -database cmpcs
#su postgres
# pg_ctl stop -D /usr/local/pgsql/data
waiting for postmaster to shut down.... done
postmaster stopped
#pg_ctl start -D /usr/local/pgsql/data -l logfile -o "-i"
#psql -U compiere cmpcs
Welcome to psql 8.0.1, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
cmpcs=#CREATE SCHEMA compiere;
cmpcs=# SET search_path TO compiere,sqlj;
cmpcs=# SELECT sqlj.install_jar('file:///app/compiere/e-evolution/cpgsql/sqlj/sqlj.jar', 'sqlj', true);
cmpcs=# SELECT sqlj.set_classpath('compiere', 'sqlj');
cmpcs=# \q
Note: You can find sqlj.jar into $COMPIERE_HOME/lib/sqlj.jar