db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: refresh JSP webpage when Derby DB is changed
Date Fri, 12 Feb 2010 19:49:26 GMT
Ronald Rudy wrote:
> This isn't really a Derby question, it's more of a web/Javascript question.
> There is no way to push data to a client.  The request always originates on the client.
> That said, IF you are so inclined you can use Ajax type calls to poll a servlet on the
server on a regular interval to check for updates.  It would still be polling, though.  Not


While the original request has to originate from the client, you don't 
have to have the client poll on regular intervals - you can use 
something like long poll or streaming to basically get an event-based 
system. Note that this requires some software on the server side, and as 
most things these techniques have their challenges.
Besides from the link already mentioned, you can have a look at 
Atmosphere ( https://atmosphere.dev.java.net/ ) and maybe post a 
question there or on a similer mailing list / forum.

Hope this helps,
> I would look at prototype if you want to start leveraging Ajax.  http://www.prototypejs.org/
  It's a good place to start.
> I would be very careful about having JS continuously polling your server though.  If
you have lots of clients you will end up with lots of requests to handle.  That code has to
be very efficient.
> On Feb 12, 2010, at 11:17:22 AM, albertkao wrote:
>> The goal is to refresh a JSP web page on a web browser when the Derby DB on
>> the server is changed.
>> The rate of database change is 1-10 times per hour.
>> The record size is about 1000 bytes.
>> The user use the browser to modify the data and write back to the Derby DB.
>> The web server is tomcat.
>> I am thinking of comet programming - pushing data from the server to client
>> when the Derby DB is changed.
>> Is that a good idea?
>> How to do that with javascript or java?
>> Any sample code or tutorial? 
>> -- 
>> View this message in context: http://old.nabble.com/refresh-JSP-webpage-when-Derby-DB-is-changed-tp27565891p27565891.html
>> Sent from the Apache Derby Users mailing list archive at Nabble.com.

View raw message