Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B51F19FB1F1 for ; Sat, 28 Jul 2007 01:42:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 85303-02 for ; Sat, 28 Jul 2007 01:42:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx01.burntmail.com (mx01.burntmail.com [69.93.121.66]) by postgresql.org (Postfix) with ESMTP id 19CD79FB1D8 for ; Sat, 28 Jul 2007 01:42:37 -0300 (ADT) Received: from pool-72-66-94-237.washdc.fios.verizon.net ([72.66.94.237] helo=[127.0.0.1]) by mx01.burntmail.com with esmtpa (Exim 4.63) (envelope-from ) id 1IEe8W-0006ru-7Z for pgsql-jdbc@postgresql.org; Fri, 27 Jul 2007 23:42:40 -0500 Message-ID: <46AAC93B.2040305@burntmail.com> Date: Sat, 28 Jul 2007 00:42:35 -0400 From: Guy Rouillier User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: problem urgent - please help References: <1185588020.46aaa3345f626@webmail.ksu.edu> In-Reply-To: <1185588020.46aaa3345f626@webmail.ksu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000761-2, 07/27/2007), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/133 X-Sequence-Number: 17307 vbhatia@ksu.edu wrote: > I have written a Java application that reads the data from a postgresql > database and retrieves a particular field, performs some actions on > that field and finally store the calculated data in some other > table.The postgresql database, however is changing continuously , since > new data is being added every minute. My problem is that I want to > write some trigger in my java application that would be invoked as soon > as there is a change in the database and perform the above actions for > that newly added row. You can write a trigger in Java. If you're asking if a trigger in PostgreSQL can invoke your standalone Java program, the short answer is no. You can probably rig something up using an untrusted PL language, though. There is no untrusted Java implementation, though, so you'd have to use another one to implement the glue code. Sounds like your best bet would be to write a trigger in Java, and just run the whole thing in the DB. -- Guy Rouillier