aspose file tools
The moose likes Java in General and the fly likes Getting automatic updates from database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Getting automatic updates from database" Watch "Getting automatic updates from database" New topic
Author

Getting automatic updates from database

Phil Maskell
Greenhorn

Joined: May 16, 2003
Posts: 6
Hi,

Not sure if this is the correct place to post this, but here goes, please let me know if there is a better place for questions like this.

I currently have a servlet based server using http comm's to a flash movie client, everything is currently working fine, I now need to push data from an oracle database to the client.

I have 2 questions:

1:

Using Oracle, does anyone know the best way to get Oracle to let me know in the Java of a data change? Triggers? I am currently only using Servlets and would like to keep it as simple as possible, only using EJB's etc... if it's the only way.

2:

I have looked into 2 ways of pushing this data to the flash client, one is the standard socket architecture, this is fairly standard and easy to implement and understand, but it needs a port to be open for this comm's, in an internet situation this might be a problem. The other idea is to use a ServletAdapter and keep the http connection from the Flash to the a Servlet open pushing data to the client as needed. Does anyone have any opinions on these 2 ideas?

Any help/discussion on these 2 questions would be greatly appreciated.

Thanks in advance.

Phil Maskell
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

1. Not unless you are using JServer (and so running you Java application in Oracle). JDBC is inherently pull in design - so there is no way to use it with a push based architecture.

2. "ServletAdapter"? Not sure what you mean by this. But:

keep the http connection from the Flash to the a Servlet open pushing data to the client as needed

This isn't how HTTP works. You have the same problem with it, and therefore HTTPServlets: they are inherently pull, not push. A servlet is not going to be able to update anything client side (like a Flash object) without a request. What you need (as you've realised) is possibly some sort of client side code which opens a socket to a serverside component which possible polls the DB for changes. I've no idea if your Flash components can do this (I've never had any use for Flash) - you suggest its not a problem so I'll take your word for it.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Getting automatic updates from database
 
Similar Threads
Persisting data from GUI application
Socket push..
is it possible
[S2] Problem using Connext Graph Plugin
NIO with Servlet 3.0 for Streaming Comet