File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes keep track of a field in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "keep track of a field in database" Watch "keep track of a field in database" New topic
Author

keep track of a field in database

danish mohd
Greenhorn

Joined: Oct 22, 2011
Posts: 12
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

Joined: Jan 10, 2002
Posts: 61770
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
danish mohd
Greenhorn

Joined: Oct 22, 2011
Posts: 12
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: 87

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 ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61770
    
  67

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: 12
help me out guys
i am unable to do it
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

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: 12
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: 87

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
Marshal

Joined: Jul 20, 2005
Posts: 10290
    
168

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: keep track of a field in database