展开全部
肯定不可以,mysql不能调用java代码,但是可以在e69da5e887aa3231313335323631343130323136353331333363373731java中创建触发器
1.使用SQL创建触发器DELIMITER $$CREATE TRIGGER `catefiles_trigger` AFTER INSERT ON `catefiles` FOR EACH ROWbegin
declare num1 int; set num1 = (select num from est_client_catescan_status where cateid=new.cateId and taskid=new.taskId and clientid=new.clientId); if(num1>=0) then update catescan_status set num=num1+1 where cateid=new.cateId and taskid=new.taskId and clientid=new.clientId; else insert catescan_status(cateid,num,status,taskid,clientid) values(new.cateId,1,0,new.taskid,new.clientId); end if; end$$
2.在Java程序里创建触发器String sql=+" CREATE TRIGGER catefiles_trigger AFTER INSERT ON catefiles FOR EACH ROW"
+" begin"
+" declare scannum int;"
+" set scannum = (select num from