This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes java class from mysql trigger how Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "java class from mysql trigger how" Watch "java class from mysql trigger how" New topic
Author

java class from mysql trigger how

praveen sharma
Ranch Hand

Joined: May 27, 2006
Posts: 44
Hi friends,

Anyone who knows how to call java servlet or java class method from MYSQL.Now in detail

I have to insert a record in a table. That table has a trigger on it. On Insert of a record trigger get called and it need to send SMS and email from java class but the problem is that trigger checks a condition if satified then only it calls java class otherwise it execute normally.

If anyone has implemented it,will be a great help !!

Regards
Praveen Sharma
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Here's a link to the MySQL documentation for setting up triggers:

http://dev.mysql.com/doc/refman/5.4/en/triggers.html

You could look through there -- I haven't -- but I very much suspect that MySQL hasn't implemented triggers written in Java yet. So you'd have to write a trigger as a stored procedure (also documented at that link) which somehow sent a message to something which was written in Java and was running somewhere else.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: java class from mysql trigger how
 
Similar Threads
Inserting a record when the table has no primary key
how to handle autogenerated numbers in oracle using CMP
what is trigger ?
How to insert using hibernate?
possible to insert data into two tables from one sql?