agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] reading a file
Date: Fri, 12 Nov 2004 01:15:04 +0100
Message-ID: <thhal-0DJlvArllby4N0xum73Vmh65wFV0FHU@mailblocks.com> (raw)
In-Reply-To: <000a01c4c82c$64fdfe20$cd8055aa@ftgebus33>
References: <000a01c4c82c$64fdfe20$cd8055aa@ftgebus33>
<41940088.4030605@mailblocks.com>
<thhal-0C5lvArNlby4SCSwfD/fchZ1U9PXtqp@mailblocks.com>
<thhal-0C5lvArVlby47WUSJ2NgdSmN0KrLWrC@mailblocks.com>
<thhal-0C5lvArdlby4zAJq9sVvRyEZ7e6gS5O@mailblocks.com>
Russell Reeves wrote:
>Hi Thomas,
>Thanks for the reply.
>Please bear with me. I'm a newbie with pljava and Postgres.
>So, if I have a jar file up in Postgres with a class that is trying to read
>a file in,
>where does it look by default?
>I think I can use what you suggested.
>I'll let you know what happens.
>Many thanks,
>Russ
>
>
Radu-Adrian Popescu wrote:
> I guess you can always use the classloader resource mechanism, and
> locate the property file[s] near your classes or in the jar.
If you are referring to the Class methods "getResource" and
"getResourceAsStream", i.e. the stuff that Radu-Adrian mentioned, I must
admit that there's a minor flaw in PL/Java at present. The resource
finder semantics are not yet implemented in the ClassLoader.
The behavior that will be implemented in the coming release is to mimic
the behavior of the standard Java ClassLoader and resolve the resource
the same way as the class is resolved, i.e. by consulting the classpath.
In PL/Java, the classpath is defined for the schema where the executing
function is defined (as set by the function set_classpath).
Regards,
Thomas Hallgren
view thread (4+ messages)
Message-ID: <thhal-0DJlvArllby4N0xum73Vmh65wFV0FHU@mailblocks.com>
Permalink: ../thhal-0DJlvArllby4N0xum73Vmh65wFV0FHU@mailblocks.com/
Also on: postgresql.org/message-id/thhal-0DJlvArllby4N0xum73Vmh65wFV0FHU@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] reading a file
In-Reply-To: <thhal-0DJlvArllby4N0xum73Vmh65wFV0FHU@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