Hi willard,

I think instead of continuously making queries from applet to servlet, it will
be better if u put a loop in servlet to execute same query for updated data in
some time intervals & start this loop when user first see this page. Then
servlet will continuously go on sending data to applet & applet will just read
the data. servlet will stop this loop if user wish to stop & send that request
to servlet.

We can do it using URL & URLConnection class.
1. Make a conenction to ur servlet using URL & URLConnection.
2. Get date & time of the content or u can use getLastModified().
3. See that the content is modified & then using getInputStream() method read
the data from the URL COnnection.
4. Make servlet send the data to this URLConnection.

Thanks,

Vijay





Willard Thompson <[EMAIL PROTECTED]> on 09/22/2000 12:48:47 AM

Please respond to "A mailing list for discussion about Sun Microsystem's Java
      Servlet API Technology." <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Vijay Deshpande/HAZIRA/RIL)

Subject:  Streaming data from database



Hello -

Does anyone know how to do consecutive queries with respect to time?  In
other words, let's say I did a simple SQL select based on an incremental key
(1,2,3, ..., n).  Say at time t the key is up to 3 and I want to get that
row and at time t+1 the key is up to 4 and I want to get that row as well
... and I want to keep getting new events/rows so that I can send it to my
continuously changing applet chart/graphic (for dynamic effects).

I'm able to do a select and send data to my applet but it's only at one
instance (static) and then the life of the servlet pretty much dies. Would
there also be a mechanism on the applet to continuously call the select (if
so I would want this without the user doing anything - like maybe an
internal loop)????

- Willard

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to