Java run by MySQL trigger

后端 未结 3 1873
太阳男子
太阳男子 2021-01-05 07:40

I am trying to create some MySQL code that will invoke a Java program from a trigger.

Here is what I have so far:

CREATE TRIGGER trig_name after inse         


        
3条回答
  •  情深已故
    2021-01-05 07:49

    A direct answer: no you can't call a java method from a mysql trigger. If you had an oracle database you could, but not mysql.

    To do what you want to do with mysql you can

    • make the code that updates the database also notify the swing application. Or you can
    • make the trigger accumulate data on pending operations in a separate table that you read periodically from the swing app.

提交回复
热议问题