• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Invoke Java program on DB Update

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
How or Is it possible to invoke a Java routine whenever a database gets updated?
Thanks in anticipation
Mrutyunjay
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would have to create a trigger, that calls a stored procedure that calls a java program(can do this from oracle, don't know about other DB's). It would probably be better to just create a trigger to do the work if at all possible.
Jamie
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In a project on which I'm working, we have the concept of change awareness (CA). For DBs that support triggers, we have triggered CA. A trigger is fired on insert/update/delete, and it places some information about the change in a change log table, housed in the same DB. We also have a program the polls the change log on a regular basis. If entries exist in the change log when it's polled, all entries are extracted, loaded into a java.util.List of Data Transfer Objects, and the list is passed to another component for processing.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just stumbled across the info that you may need while doing some of my own research on a different topic:
http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83728/04jserv2.htm#1006439 describes how to call a java stored procedure from a trigger which is invoked on an insert, update or whatever you specify... but again, it is for Oracle.
Jamie
 
Mrutyunjay Hanchinal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thanks for the info.
Regards
Mrutyunjay
 
reply
    Bookmark Topic Watch Topic
  • New Topic