• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

keep track of a field in database

 
danish mohd
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
danish mohd
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
Android Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have also used this timer in my project for sending sms & mail.
Study the:

java.util.Timer;
java.util.TimerTask;
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's different and has nothing to do with JSP. So I've moved this to a more appropriate location.
 
abani patra
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I will suggest using Quartz scheduling for this. That will be better for your requirement.
 
danish mohd
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
help me out guys
i am unable to do it
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to have to ask a more specific question than that. What exactly are you having a problem with?
 
danish mohd
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
Android Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right Sunil Sunny. But, it will slow down the system.
 
Sunil Sunny
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic