MySQL 监听通知等效 [英] MySQL listen notify equivalent

查看:47
本文介绍了MySQL 监听通知等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有等效于 PostgresQL 的 notifylisten 在 MySQL 中?基本上,我需要在我的 Java 应用服务器中监听触发器.

Is there an equivalent of PostgresQL's notify and listen in MySQL? Basically, I need to listen to triggers in my Java application server.

推荐答案

不,目前还没有任何像这样的内置函数.您需要ping"(每 1-5 秒)数据库并选择读取"0/1 等预制标志.

No, there aren't any built-in functions like these yet. You need to "ping" (every 1-5 seconds) database with selecting with premade flag like "read" 0/1. After

SELECT * FROM mytable WHERE read = 0

用 read = 1 更新它

update it with read = 1

这篇关于MySQL 监听通知等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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