database notification

I would like to know is it possible that when each time a record is inserted or update in database table, then it will notify a java program to some tast like send email out? (not using trigger)Is there are API or framework out there that provide this feature?
[274 byte] By [robotdoggia] at [2007-11-26 18:11:29]
# 1

A possible way would be to use AOP (Aspect Oriented Programming) to intercept the (java) method calls that do the database legwork. not ideal in a distributed - or mixed-language - environment, though. AspectJ is the pick of the AOP bunch, but is essentially a new extension to the language. Spring's AOP is nice and useable, or depending on exactly what your code looks like, you could roll your own solution

georgemca at 2007-7-9 5:44:03 > top of Java-index,Java Essentials,Java Programming...
# 2
What is the reason for not using a trigger, as this is probably your best solution?
abillconsla at 2007-7-9 5:44:03 > top of Java-index,Java Essentials,Java Programming...
# 3
Another way would be to use Java Messaging (JMS) and teach the db to notify the application through the message system that it did something, but none of this is exactly the easiest thing to put together. It works, I've done it but it isn't a trivial effort.PS.
puckstopper31a at 2007-7-9 5:44:03 > top of Java-index,Java Essentials,Java Programming...