Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Mail Alerts on birthdays

 
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

Currently I am working on a project which uses servlets and jsp. I am sending mails from my jsp page. But now I have struck at one point. I need to send automatic mail on his birthday date which he registered . I am using mysql database as back end . Any solution will be most useful for me.

Thanks in advance.
 
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP and servlets will be of no help to you in this task.
 
Marshal
Posts: 27289
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is preventing you from getting a solution?

(We don't like to do people's work for them here, but we do like to work with them as they do it.)
 
Ranch Hand
Posts: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaMail would be of help for your project
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:JSP and servlets will be of no help to you in this task.




Sir How can i achieve this without servlets and jsp's . Is there any other technology or else please give me your valuable reply...
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ashwin Sridhar wrote:JavaMail would be of help for your project




Actually I am sending mails when clicking on button like "tell to friend" but what is my intention is there must be a thread that must be working as long as the application is in server whether client requests or not .


Executing a thread until server stops.... this is my requirement any suggestion....

Thanks in advance
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:What is preventing you from getting a solution?

(We don't like to do people's work for them here, but we do like to work with them as they do it.)




Actually I am sending mails when clicking on button like "tell to friend" but what is my intention is there must be a thread that must be working as long as the application is in server whether client requests or not .

I struck at how to run a thread continuously until server stops/ application is deleted from server.
 
Bear Bibeault
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd just write a standalone application that would be triggered by a cron job once a day and send out emails as necessary.
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks for replying sir,

Bear Bibeault wrote:I'd just write a standalone application that would be triggered by a cron job once a day and send out emails as necessary.




Sir i think i have to use threads is n't it? if it which thread i have to use.

 
Bear Bibeault
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, why? Just write an application that checks the db for birthdays, sends out emails as appropriate, and shuts down. Run it once a day as a cron job. Why make things more difficult than they need to be?
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:No, why? Just write an application that checks the db for birthdays, sends out emails as appropriate, and shuts down. Run it once a day as a cron job. Why make things more difficult than they need to be?



Thanks for reply

I am unaware of cron jobs as i am fresher. is there any API to built cron jobs in java . when i searched in google it shows Quartz API to develop cron jobs any other resource i don't want to use any third party tools like quartz is there any please reply me I am eagerly waiting for your reply....
 
Bear Bibeault
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's the other way around, cron starts the Java program. Again, you are making this too complicated.

On Windows, you'll need to find the equivalent for cron.
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:It's the other way around, cron starts the Java program. Again, you are making this too complicated.

On Windows, you'll need to find the equivalent for cron.



Thanks for reply,


This answer is correct if in my own system i have to send mails ,

But equivalent to cron jobs is Scheduled tasks in windows I may configure this tasks in my windows system. But requirement is I have to place application in server(On web). and takes date of birth from mysql database using JDBC and sends mail...
 
Bear Bibeault
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the server a Unix system?
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Is the server a Unix system?



yes sir.
 
Bear Bibeault
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then it will have cron.
 
mike mimmis
Ranch Hand
Posts: 57
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Then it will have cron.



I got the solution Thanks a lot sir......
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic