agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] RE: Loading of native libraries in PLJAVA
Date: Fri, 11 Mar 2005 11:14:04 +0100
Message-ID: <42316F6C.9040609@mailblocks.com> (raw)
In-Reply-To: <3214799999CED64882731155DB0AAD92C4797D@MLSW00103>
References: <3214799999CED64882731155DB0AAD92C4797D@MLSW00103>
Mohammed
>We have written a insert trigger on network table, when ever
>there is insertion in the table, we are reading a property file and modify
>the values with the inserted data and insert the modified values in another
>table.
>We are unable to read the properties file (which is present in the installed
>jar file at the root as well as at the class file level)
>
>Here is the hierarchy structure, where i have placed properties files
> gis.jar
> gis.properties
> com
> me
> mis
> pgtrigger
>
>PropertiesTrigger
>
>gis.properties
>
>.
>
>Here is the code to access gis.properties file
>
> PropertiesTrigger.java
>
> Properties properties = new Properties
> InputStream is =
>this.getClass().getResourceAsStream("gis.properties");
> SOP ("INPUTSTREAM "+is);
> properties.load(is);
> is.close();
>
> null at SOP for the inputstream.
>
>
Your code looks correct aside from some missing parenthesis :-).
Just to rule out a couple of possibilities, can you load the
"examples.jar" that is bundled with the PL/Java using sqlj.install_jar
and set the classpath for schema 'javatest' to 'samples' and then run:
SELECT * FROM javatest.propertyExample();
You should get 3 rows. If that works then properties and resources work
OK (it does on my installations). If it doesn't, then something is
majorly wrong.
Is it possible that you have an external CLASSPATH setting that in fact
results in another jar then the one being loaded is used? The external
classpath should _only_ appoint pljava.jar.
What versions of PostgreSQL, PL/Java, and JRE are you using?
Regards,
Thomas Hallgren
view thread (2+ messages)
Message-ID: <42316F6C.9040609@mailblocks.com>
Permalink: ../42316F6C.9040609@mailblocks.com/
Also on: postgresql.org/message-id/42316F6C.9040609@mailblocks.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] RE: Loading of native libraries in PLJAVA
In-Reply-To: <42316F6C.9040609@mailblocks.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox