Re: - trigger/function & java methods

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: - trigger/function & java methods
Date: 2003-08-15 23:18:33
Message-ID: 20030816001833.A5868@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


On 15/08/2003 16:37 sarathi(at)excite(dot)com wrote:
>
>
> Hi All,
> I would like to know how to call a java method from sql trigger
> code or a function.

I'm no expert on this (in fact, I try to avoid using SPs as it embeds
business logic within the database - not nice) but the only way I can that
you could currently do this would be to write a C function which spawns a
JVM and executes your class. I'm confident that you're a sufficiently
experienced developer to instantly realize that this would almost
certainly bring the server to its knees :-(

That said, I'm curious about why you want to call a Java SP (other than
you can't implement some essential function without resorting to SPs and
you don't have time to learn a new language..).
rgds

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2003-08-16 00:04:29 Re: CVS JDBC driver will try to use server-side-prepare on unpreparable SQL
Previous Message Oliver Jowett 2003-08-15 23:14:28 Re: CVS JDBC driver will try to use server-side-prepare on unpreparable SQL