agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] How use external java class ?
3+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] How use external java class ?
@ 2005-07-11 13:13 
  2005-07-11 13:16 ` [Pljava-dev] How use external java class ? 
  2005-07-11 13:37 ` [Pljava-dev] How use external java class ? 
  0 siblings, 2 replies; 3+ messages in thread

From:  @ 2005-07-11 13:13 UTC (permalink / raw)

Hi,

how to set the classpath to use external java classes ?

ie :

POSTRGRES / PLJAVA call a method in a class out of postgres.

Best regards,

Brice.


-- 
Brice Rouanet
I.N.S.A.  Centre de Ressources Informatiques
Complexe Scientifique 135 Avenue de Rangueil
31077 Toulouse Cedex4 (France)  tel 0561559374





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] How use external java class ?
  2005-07-11 13:13 [Pljava-dev] How use external java class ? 
@ 2005-07-11 13:16 ` 
  1 sibling, 0 replies; 3+ messages in thread

From:  @ 2005-07-11 13:16 UTC (permalink / raw)

brice rouanet wrote:

> Hi,
>
> how to set the classpath to use external java classes ?
>
> ie :
>
> POSTRGRES / PLJAVA call a method in a class out of postgres.
>
> Best regards,
>
> Brice.
>
>
I'm not sure what you mean by "external". Can you elaborate please?

Regards,
Thomas Hallgren






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] How use external java class ?
  2005-07-11 13:13 [Pljava-dev] How use external java class ? 
@ 2005-07-11 13:37 ` 
  1 sibling, 0 replies; 3+ messages in thread

From:  @ 2005-07-11 13:37 UTC (permalink / raw)

Yes, you normally load all 50 jars into PostgreSQL. There's a couple of 
reasons for that:

1. There's a difference in how you access the file-system and the 
database server. A client often resides on another machine and access 
the server using TCP/IP. So there's no guarantee that a jar file that 
resides on the client can be accessed by a server and no guarantee that 
a client have access to install files in the file system on the server 
machine.

2. A trusted language in the database is not permitted to access the 
file system on the server. To allow that would be very insecure. PL/Java 
can use the PostgreSQL grant/revoke etc. to control who can install a 
jar file and access the functions there. If jar files could simply be 
placed in the file-system all such control would be in vain.

3. If you use database replication, you'd probably like changes to jars 
that is part of your app to be replicated as well.

Having said that, there still is a way to actually have jars reside in 
the file system. But to access them you have to use the untrusted 
version of PL/Java, i.e. your functions must be declared with LANGAGE 
'javaU' (only the super user can declare such functions but anyone can 
run them). If they are, then you can set the pljava.classpath 
environment in postgresql.conf to include your jar files. But please 
note, this is NOT something that I recommend. A much better solution is 
to create a script that maintains your jars in the database.

Regards,
Thomas Hallgren

brice rouanet wrote:

> Yes,
> but if I have 50 jars files, i must install all files into postgres ?
> At time i have just a jar file in postgres with a simple function 
> which is call a method (callClient(TriggerData td)) which is a XML RPC 
> client...
>
> Thx
> Brice.
>
>> No, you load the jar into the database using the sqlj.install_jar and 
>> sqlj.set_classpath commands. Please read the user guide.
>>
>> Regards,
>> Thomas Hallgren
>>
>> brice rouanet wrote:
>>
>>> I'm not really good in english, but I will try to explain this.
>>>
>>> I have a jar in /home/brice/test.jar, and I want than the Pl/Java 
>>> function call a methode in test.jar,
>>> is I must add my jar in the classpath setting of postgres.conf ?
>>>
>>> Thanks,
>>> Brice.
>>>
>>>
>>>> brice rouanet wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> how to set the classpath to use external java classes ?
>>>>>
>>>>> ie :
>>>>>
>>>>> POSTRGRES / PLJAVA call a method in a class out of postgres.
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Brice.
>>>>>
>>>>>
>>>> I'm not sure what you mean by "external". Can you elaborate please?
>>>>
>>>> Regards,
>>>> Thomas Hallgren
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-07-11 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-11 13:13 [Pljava-dev] How use external java class ? 
2005-07-11 13:16 ` 
2005-07-11 13:37 ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox