Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

info from database  RSS feed

 
Rosa Thimerman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everybody, I'm very new to all this, so please help:
I need to create aprocess wich will take sertain info from database (user login info) and will send a weekly report by e-mail. All info should be tab separated.
Please help, point me somewhere where I can find some examples how to do this.
thanks a lot.
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an overview and a couple of links.
1) Create an application with the typical public void main...
2) create a JDBC connection, use a Statement object to do your sql SELECT
[SEE]http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
3) Format the resultset into the email body
4) Use the JavaMail api to send you email ( of course, you'll have to have a mail server or similar avaiable to the application)
[SEE]http://www.javaworld.com/javaworld/jw-06-1999/jw-06-javamail.html
5) to automate this process weekly will depend on the environment you are working in. For unix, you'd use a "cron" job
http://acit.cgu.edu/acit/help/cron.html http://www.ualberta.ca/CNS/HELP/unix/crontab.1.html
For NT, there are some helper apps out there for scheduling, I believe. Hope this helps.
Sean
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!