agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] PLJAVA Trigger Function more arguments
Date: Wed, 02 Nov 2005 15:15:03 +0100
Message-ID: <4368C9E7.60202@tada.se> (raw)
In-Reply-To: <5234B8D9C36F9E4D9B1AF01013708B6B0152C03A@txindoki.tekniker.es>
References: <5234B8D9C36F9E4D9B1AF01013708B6B0152C03A@txindoki.tekniker.es>
Ignacio L?zaro wrote:
> Hello
>
> I have the table 'elementos_intalacion_monitorizar' with the fields 'value' and 'code'
> After one UPDATE of this table I want send a UDP message to a port of a IP with the code and value modified (only if the value has changed)
>
> I have a java class to send a UDP message and the required parameters are IP, port and code&value. IP and port are defined in a table named configuration
>
> So what I need, is to define a trigger that
> 1- check if the value of the code has really changed
> 2- get the ip and port from configuration table
> 3- execute the java class that send the UDP message with the required values
>
> What I have done
> 1- I have installed in postgreSQL the java class
> 2- I have defined the TRIGGER and FUNCTION explained before, but as I can understand with your last message and for my tests is that it is not possible get dinamically from a table the ip and port values inside the definition of the trigger
>
> My question at this stage : is there another way of executing a java class from PostgreSQL trigger or function?
>
>
A trigger has a concept of an 'old' and a 'new' row. What you're after
is the 'new' row, i.e.
ResultSet newRow = td.getNew();
String value = newRow.getString("value");
String code = newRow.getString("code");
Regards,
Thomas Hallgren
view thread (10+ messages) latest in thread
Message-ID: <4368C9E7.60202@tada.se>
Permalink: ../4368C9E7.60202@tada.se/
Also on: postgresql.org/message-id/4368C9E7.60202@tada.se
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] PLJAVA Trigger Function more arguments
In-Reply-To: <4368C9E7.60202@tada.se>
* 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