我可以通过mysql触发器在mysql之外执行任何程序吗? [英] Can I execute any program outside mysql through mysql triggers?

查看:469
本文介绍了我可以通过mysql触发器在mysql之外执行任何程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立电子邮件通知服务,要求在他注册时向用户发送电子邮件。
目前我正在考虑执行触发器中定义的某些函数,它可能是一个java函数,它必须在mysql进程之外,而不是监控外部数据库中用于添加数据库的mysql。



在mysql中是否有任何可用的功能,以便我可以从数据库触发器执行我的java函数?

解决方案如果你使用Java作为数据库的前端,为什么不用Java中间层代码而不是触发器呢?数据库用于持久性。如果您稍后决定使用其他形式的通知,则会发现将它添加到Java而不是MySQL更容易。


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆