我可以通过mysql触发器在mysql之外执行任何程序吗? [英] Can I execute any program outside mysql through mysql triggers?
问题描述
我正在建立电子邮件通知服务,要求在他注册时向用户发送电子邮件。
目前我正在考虑执行触发器中定义的某些函数,它可能是一个java函数,它必须在mysql进程之外,而不是监控外部数据库中用于添加数据库的mysql。
在mysql中是否有任何可用的功能,以便我可以从数据库触发器执行我的java函数?
I’m building email notification service, requirement is to send an email to user when he is registered. Currently what I’m thinking of execution of some function defined in trigger, can be a java function, which have to be outside the mysql process, rather monitoring mysql from outside for row addition in database.
Is there any functionality available in mysql, so that I can execute my java function from database triggers?
If you're using Java for the front end to a database, why not do it in the Java middle tier code instead of the trigger? Databases are for persistence. If you decide to use another form of notification later on you'll find it's easier to add it to Java rather than MySQL.
这篇关于我可以通过mysql触发器在mysql之外执行任何程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!