参考Execution of a java program by a trigger:
使用 MySQL User-Defined Function 并安装 lib_mysqludf_sys
delimiter | CREATE TRIGGER testtrigger BEFORE UPDATE ON T1 FOR EACH ROW BEGIN DECLARE result int(10); IF NEW.Flag <> OLD.Flag THEN SET result = sys_exec('/path/to/javabin -jar your.jar'); -- other kind of works and checks... END IF; END; |
http://wenku.baidu.com/view/8ab4a44ff7ec4afe04a1df76.html