使用Java进行数据库轮询 [英] database polling using Java

查看:106
本文介绍了使用Java进行数据库轮询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被困在需要用Java代码更改数据库的地方.请求是获取任何在db的任何表中更新,添加,删除的记录;应该被Java程序识别.如何实施JMS?或Java线程?

I am stuck at some point wherein I need to get database changes in a Java code. Request is to get any record updated, added, deleted in any table of db; should be recognized by Java program. How could it be implemented JMS? or a Java thread?

更新:谢谢你们的支持,我实际上正在使用Oracle作为数据库和Weblogic 10.3研讨会.实际上,我想从一个只有阅读权限的表中获取更新,所以伙计们大家都建议什么.我无法更新数据库.我唯一能做的就是读取数据库,如果表中有任何更改,我必须获得有关某些数据行已添加/删除或更新的信息/通知.

Update: Thanks guys for your support i am actually using Oracle as DB and Weblogic 10.3 workshop. Actually I want to get the updates from a table in which I have only read permission so guys what do you all suggest. I can't update the DB. Only thing I can do is just read the DB and if there is any change in the table I have to get the information/notification that certain data rows has been added/deleted or updated.

推荐答案

除非数据库可以向Java发送消息,否则您将必须具有一个轮询线程.

Unless the database can send a message to Java, you'll have to have a thread that polls.

一个更好,更有效的模型将是引发变更事件的模型.在内部运行Java的数据库(例如Oracle)可以做到这一点.

A better, more efficient model would be one that fires events on changes. A database that has Java running inside (e.g., Oracle) could do it.

这篇关于使用Java进行数据库轮询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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