监控数据库:MySQL
我写信寻求建议。 我必须监视 mysql 数据库上的某些“插入”。 用什么方式来做这个比较方便呢? 该应用程序使用 Servlet 和 MySQL。 非常感谢
I am writing to ask for advice.
I have to monitor certain "insert" on a mysql db.
In what way is more convenient to do this?
The application uses Servlets and MySQL.
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
取决于您使用的持久性框架。
拦截器
并挂钩onSave()
。这与 servlet 无关。 Servlet 只是一个用于拦截 HTTP 请求的 API。您的数据访问层应该独立且透明。
Depends on the persistence framework you're using.
Interceptor
and hook ononSave()
.@PrePersist
or@PostPersist
annotation.This is unrelated to servlets. The servlet is just an API for intercepting on HTTP requests. Your data access layer should be independent and transparent from that.