Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

polling database from jsp

 
Varma dandu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dudes,

I am working on an application which list out entries from a database(MSSQL).

These entries get updated by another application every second and i need to display the very latest info on my jsp page.

This means that i need to update part of jsp page(I dont want to refresh the whole page as it increases the network traffic) atleast for every 2 seconds by accessing the database.

can someone throw light on this.

Regards
Varma Dandu
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34179
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Varma,
If you are using a modern browser, you can use iframes. This is the technique gmail uses to update a small part of the page.

I'm moving this to JSPs as it is more about page rendering than the database.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also want to research XMLHttpRequest to perform "behind the scenes" requests to the server.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Implement Thread in Applet and include Applet in your JSP page.

Set sleep time 2 seconds.

In run() of Applet, fetch the information and display it.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Implement Thread in Applet and include Applet in your JSP page.

Set sleep time 2 seconds.

In run() of Applet, fetch the information and display it.
 
Varma dandu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanz dudes for all ur replies.

I am actually bewildered with the options.

IFRAMES , XMLHTTPREQUEST , XML-RPC.

can anyone let me know which is best option where i need to get info and display it from a very dynamic database.

Thanx
Varma Dandu.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Varma dandu:
I am actually bewildered with the options.

IFRAMES , XMLHTTPREQUEST , XML-RPC.


As Bear said, XMLHttpRequest. Others are something else.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are all client side techniques.
XmlHttpRequest is a fairly new feature in javascript and may not be supported in older browsers.

Iframes have been around longer and will probably be supported in more browsers but they are more work.

I found this article to be useful:
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many options. And it can be bewildering, but when it comes down to it, only you can decide which is best for you. This is a good opportunity to learn a little about all the options presented so that you can make an informed choice.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic