aspose file tools*
The moose likes JDBC and the fly likes live data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "live data" Watch "live data" New topic
Author

live data

wu jong
Greenhorn

Joined: May 31, 2005
Posts: 13
The data tables in my oracle 9i database change frequently and I want to find a way to get some form of notification (preferrably along with the changed data) to be called in my java app hosted by a servlet container such as Tomcat - what is the best way to go ?

My priliminary reading of oracle specific RowSets indicates that it can notify only if changes are made to its reference and are not when changes are done by somebody else to the database through some other process.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Have a read up on "triggers", these can be performed before/after inserts, updates, deletes on your table.
wu jong
Greenhorn

Joined: May 31, 2005
Posts: 13
yes, I am looking for the best way to notify my middle tier components to get a notification whenever there is a database update

?
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

what do you want to achieve !!

Database change can be notified to databse object using trigger, but for java program to be notified you need to query database.

could you explain you requirement in details.

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Well you could have your trigger (which in Oracle I think can be written in java) write the database changes as they occur to some external resource (a message queue might be an idea), then your middle tier component can be listening incoming messages on that queue for example.
 
jQuery in Action, 2nd edition
 
subject: live data
 
Similar Threads
Publishing to another database
Notifiying EJB when database table changes
Excel Data Population using Java
Insert multiple rows in database
Modifying XML files from Oracle