hai to all..
help me to solve my problem...
im dng one project..in my project i do have one database.. it wil be updated for every 30seconds.. so i have to display the data from database with thier updates.i mean i would like to display data's in the client browser..whenever there is an update in data base the browser should display the recent datas from database..
here i m using ajax with 30 seconds interval to refresh broswer and making cal to jsp page after 30seconds. so after every 30 seconds ajax wil cal my jsp.. jsp wil retrieve datas from databse..

its running fine and getting refresh for every 30seconds..
bt display's the same data wat displayed in first time..
bec here jsp is compiled servlet(it means jsp with retrieved data wen it is compiled).. so my ajax caling compiled jsp and gives the output from compiled jsp..so its giving same result.. its not giving recent datas..

i explained my problem as much wat i can..

i wil try explain if any one cant get..

help me....

First thing you could do to help us is get rid of that SMS or Instant Messaging language to let us understand your problem better and get rid of the ".."s we are not playing fill in the blanks here, and finally use a spell check.

Next do not do database connectivity directly inside a JSP. And also paste the code of the JSP you are talking about, cause honestly what you are saying defies logic to me.

Also note when JSP is converted to a servlet, it is not executed. So no data will be fetched at the this time, Its just like when you write a normal Java application, during compile time the code is converted into a class file (it is not executed) and only when you specify "java <main-class-name>" it is executed and thats when the data fetching happens.

Please a sincere suggestion to you is first concentrate on the basics of the language before jumping in to advanced topics. What I have mentioned here would have been covered in any book on JSPs in the first or second chapter itself. The greatest towers in the world stand because they have a strong foundation underneath. Similarly you should never leave out the basics and just jump to advanced topics just to save time, in fact you will end up spending more coming back to the basics each and every time you run into any sort of trouble.

This article has been dead for over six months. Start a new discussion instead.