| Author |
Display one record per current date
|
usha mocherla
Ranch Hand
Joined: Sep 24, 2004
Posts: 33
|
|
hi all, I have a problem to slove. I have table with me fields id and description. what i want to do is i have to display each record on current date.means on change of system date i have to change the record discription. so any ideas plz thanks in advance
|
 |
Mehul Sanghvi
Ranch Hand
Joined: Feb 04, 2002
Posts: 134
|
|
Hi, I guess defining a job on database would be an easier option. If you want to do it thru a client java application, in that case you will need to write a Thread which will keep running and at 12 midnight make a DB connection and update the value in the table. I hope this helps. Regards, Mehul K. Sanghvi.
|
 |
usha mocherla
Ranch Hand
Joined: Sep 24, 2004
Posts: 33
|
|
hi Mehul Sanghvi , Thanks for the reply, but sorry i could not communicate my problem clearly it seems ex:suppose i have 40 records with me. on change on sysdate i have to display a new record on my jsp page. after completion of 40 records again it should start with 1st record and display each one on change of sys date. so any suggestions plz regards Usha
|
 |
Mehul Sanghvi
Ranch Hand
Joined: Feb 04, 2002
Posts: 134
|
|
Hi again, Sorry for the misinterpretation of your question. And just to clarify that I have got it right this time you want a functionality some what similar to displaying maybe a quote of the day on your jsp, right? Well the way I would do it is, define a table in db(or a property file on web server) which will hold the id of the current description being displayed and the date when the id was set. And then while the jsp is displayed check for the set date to current date, if these are not same then query the db for description where id = currentId+1. Regards.
|
 |
 |
|
|
subject: Display one record per current date
|
|
|