• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic