Forums Register Login

Not Getting the Latest data from databases in jsp page

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
2
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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



+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
1
+Pie Number of slices to send: Send
Ajax is a lot less painful if you use jQuery. I highly recommend jQuery in Action by our own beloved Bear.
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1840 times.
Similar Threads
Jrame not visible when Try to run from Unit Test
Sending a jsp page as the content of an email
Controlling values in JSF.
JSP pages list view and grid view
The import org.apache.commons.lang.StringEscapeUtils can not be resolved
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:05:34.