This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes java event on sql insert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java event on sql insert" Watch "java event on sql insert" New topic
Author

java event on sql insert

Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
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

Joined: Jul 09, 2001
Posts: 1879

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
 
Consider Paul's rocket mass heater.
 
subject: java event on sql insert
 
Similar Threads
how to execute pl/sql procedure using ant.
Executing HQL queries along with SQL Queries
Problem with executeUpdate
Unable to Send Java mail
Oracle9i wrong number or types of arguments in call to...