如何用java创建触发器

Python018

如何用java创建触发器,第1张

java是应用程序,可以通过jdbc接口调用触发器

create or replace trigger bj_customer

before update on customer

for each row

begin

update order set

cu_no=:new.cu_no,

cu_name=:new.cu_name,

cu_address=:new.cu_addess,

where cu_no=:old.cu_no;

end

调用executeUpdate方法即可

触发器顾名思意就是在某个动作执行时自动触发执行的,不用调用,比如你是在add和delete数据时加触发器,只要你定义的对,数据库在向你指定的那张表add和delete数据时,该触发器就会自动触发