| Author |
keep track of a field in database
|
danish mohd
Greenhorn
Joined: Oct 22, 2011
Posts: 11
|
|
hi guys
i am working on my final year project.
in this i am making a reminder system for which i have to get input the time at which i must remind the user.now the problem is that how to know that now its the time to remind the user.
one of my approch is that i must implement a thread that interact with database and get the reminders to be remind in next 30 min.
how can i use this approach on jsp.
or can you suggest me any other approach ...
thank you in advance
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
Can't be done. When the time is up, how do you know where the user is surfing, or if he or she is even around their computer? They could be looking at Facebook, viewing videos, reading CodeRanch, or off bungeee jumping for all you know.
HTTP allows you to respond to requests made from the browser -- it's not a real-time protocol.
If, and only if, the user just happens to be on a page that you create, that page can poll with Ajax to see if it's time to make a notification. But only in that case.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
danish mohd
Greenhorn
Joined: Oct 22, 2011
Posts: 11
|
|
thank you for reply
let me make it a bit easy .
i just want to send a mail and an sms to the user,as and when its the time of the reminding an sms and a mail is forwarded to him using mail and sms jars.
thank you
|
 |
Aniket S. Kulkarni
Ranch Hand
Joined: Jun 15, 2011
Posts: 78
|
|
I have also used this timer in my project for sending sms & mail.
Study the:
java.util.Timer;
java.util.TimerTask;
|
Aniket Kulkarni
Oracle Certified Professional, Java SE 6 Programmer.
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
|
That's different and has nothing to do with JSP. So I've moved this to a more appropriate location.
|
 |
abani patra
Ranch Hand
Joined: Oct 11, 2011
Posts: 70
|
|
Hi,
I will suggest using Quartz scheduling for this. That will be better for your requirement.
|
 |
danish mohd
Greenhorn
Joined: Oct 22, 2011
Posts: 11
|
|
help me out guys
i am unable to do it
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 13842
|
|
|
You are going to have to ask a more specific question than that. What exactly are you having a problem with?
|
 |
danish mohd
Greenhorn
Joined: Oct 22, 2011
Posts: 11
|
|
i am working on my final year project.
in this i am making a jsp based reminder system for which i have to get
input time at which i must remind the user by sending him a sms and e-mail.
i have taken time to remind by user and saved it into database.i have to interact with database and at that particular time i have to send an sms and email to user.
now the problem is that how to know that now its the time to send sms.
Thanks
|
 |
Sunil Sunny
Ranch Hand
Joined: Oct 18, 2011
Posts: 41
|
|
i do not think it is possible. bit 1 idea is you create a J2se page and use timer class of java to check the time after every 50 seconds. You must have a computer running all the times that J2se page created. you can't ensure this on web platform as you must have to run a page everytime and sit it nearby.
this might also be possible with ajax asyou run the page and use ajax to send arequest after a particular time interval.
|
 |
Aniket S. Kulkarni
Ranch Hand
Joined: Jun 15, 2011
Posts: 78
|
|
You are right Sunil Sunny. But, it will slow down the system.
|
 |
Sunil Sunny
Ranch Hand
Joined: Oct 18, 2011
Posts: 41
|
|
Aniket S. Kulkarni wrote:You are right Sunil Sunny. But, it will slow down the system.
ya absolutely it will slow down the and also the size of database is always expected to increase once the site is published.
|
 |
Jaikiran Pai
Saloon Keeper
Joined: Jul 20, 2005
Posts: 6720
|
|
There are many ways to do this. Quartz is one popular framework which allows you to persist the schedule information and also triggers your persistent jobs. The Quartz site has useful tutorials too http://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/
|
[My Blog] [JavaRanch Journal]
|
 |
 |
|
|
subject: keep track of a field in database
|
|
|