• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not Getting the Latest data from databases in jsp page

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i am trying to fetch Latest Data from Databases in a continous manner for a particular time interval , i am getting but data not display in front page in a continous way it only display old data what shoud i do , I am using javascript ,core java with Oracle Database


Thanks
Scp
 
Greenhorn
Posts: 6
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

if you are not using ajax then I believe that you are using simple javscript code to generate the event to call requesting Page. Please check that how you are storing the result set data and getting data on jsp.

You can utilize collections classes to store result data pass it in the request on jsp page.

if you are doing same. post sample of code you are implementing.

Cheers,

Krutik
 
sadhu charan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krutik
I am using javascript setTimeInterval method and calling java method got the value but its continuosly not display value only it display value while it is loading the page , if you have Ajax sample or code which continuosly checking Database and display data then help me


Thanks
Scp
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would be useful if we had some idea of how you were calling a Java method from your Javascript code. Right now we have essentially no information about what you are doing, so making suggestions about what you should be doing is clearly impossible. So show us how you are doing that.
 
sadhu charan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i am just using setTimeInterval method inside setinterval methods i call a java function which get the data from data base Like:-

My code is like thats but it fetching only once not a one second interval , so if you have any ajax code or sample please send it

Thanks
Scp



 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, I see. You are making a common mistake, namely you think that the HTML scriptlet is repeatedly evaluated in the browser. That isn't the case -- your JSP runs on the server and generates HTML (including Javascript) which is interpreted by the browser. If you use the "Display Source" feature in your browser you'll see that this is the case.

But for a better explanation, read The Secret Life of JavaServer Pages.

And yes, to do what you want to do you are going to have to use Ajax. However asking for random fragments of Ajax to be posted isn't going to be very useful, you're going to have to spend some time learning about it. Snippets aren't the way to go.
 
Krutik pandya
Greenhorn
Posts: 6
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, ajax is the way in your case. you ask the sample code. however, It will be better, you get basic idea and learn ajax first rather asking direct help.

W3school site is very nice to begin with ajax.

cheers,

Krutik
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajax is a lot less painful if you use jQuery. I highly recommend jQuery in Action by our own beloved Bear.
 
I was born with webbed fish toes. This tiny ad is my only friend:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic