From: | thhal at mailblocks(dot)com (Thomas Hallgren) |
---|---|
To: | |
Subject: | [Pljava-dev] java.lang.ClassNotFoundException: org.postgresql.pljava.example.Users |
Date: | 2005-03-31 18:18:53 |
Message-ID: | 424C3F0D.4020906@mailblocks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
Antonio Carlos de Andrade Brito wrote:
> Hi... How can i to run the listSupers() function that is write at
> userguide ?
> When i type select listSupers() the follow message is showed "
> java.lang.ClassNotFoundException: org.postgresql.pljava.example.Users,".
> And i try set examples.jar, at Classpath bus doens?t working...
> I just to run the example:
>
> " CREATE FUNCTION getsysprop(VARCHAR)
> RETURNS VARCHAR
> AS 'java.lang.System.getProperty'
> LANGUAGE java;
>
> SELECT getsysprop('user.home');"
>
> This function is working ok!
>
> Please, help me...
> Antonio Carlos
>
> My enviromment
>
> CLASSPATH=
> %CLASSPATH%;deploy.jar;..\jdbc\postgresql-8.0.309.jdbc2.jar;pljava.jar;C:\Arquivos
>
> de programas\PostgreSQL\8.0\pljava\examples.jar
>
> PATH=
> C:\j2sdk1.4.2_05\bin;C:\j2sdk1.4.2_05\jre\bin\client;
>
You need to load the examples.jar into the database using
sqlj.install_jar. Start psql and enter the following commands:
SELECT
sqlj.install_jar('file:/C:/Arquivos%20de%20programas/PostgreSQL/8.0/examples.jar',
'samples', true);
SELECT sqlj.set_classpath('public', 'samples');
That should do it but you should adjust your CLASSPATH also. The
PostgreSQL backend (the postmaster) should see a CLASSPATH where *only*
the pljava.jar is listed. Since you use a 8.0, you can set this
classpath in the postgresql.conf file. The client programs you use
should *never* see the pljava.jar and they don't need to see
examples.jar since it's loaded into the database. So, in
postgresql.conf, enter:
custom_variable_classes = 'pljava'
pljava.classpath = '<full path to pljava.jar>'
The full path must use escaped backslashes, i.e. '\\' since
postgresql.conf will treat backslash as an escape in itself.
Regards,
Thomas Hallgren
From | Date | Subject | |
---|---|---|---|
Next Message | Antonio Carlos de Andrade Brito | 2005-03-31 18:30:58 | [Pljava-dev] java.lang.ClassNotFoundException: org.postgresql.pljava.example |
Previous Message | Antonio Carlos de Andrade Brito | 2005-03-31 18:17:39 | [Pljava-dev] Other question... |