Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java event on sql insert

 
Peter Straw
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Is it possible to have some java code executed( such as sending mail) when a certain field in a database table is updated?
I am using ms-sql server 7. I know that there are triggers, but these seem to be confined to running sql statements not running java code.
Thanks in advance,
Peter
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know about ms-sql server 7, but in Oracle you can call java programs from database triggers... but that doesn't really help you now does it!
The only alternative that I can quickly think of, is to check the condition in your java program before you insert/update through java. If the condition is right, execute the java, if not, just insert.
Jamie
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!