• Post Reply Bookmark Topic Watch Topic
  • New Topic

generating text file and sending that file as mail attachment  RSS feed

 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to generate a text file through JAVA.I need to write resultset data into that text file.Then I want to attach that file as mail attachment?

CAn anybody provide code for this task?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which part are you unsure about how to do - getting the data from the database, writing it to a file, or sending an email with an attachment? What do you have so far?
 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont have anything so far.I need code for getting the data from the database, writing it to a file, or sending an email with an attachment.

But I am trying.
 
dhwani mathur
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link shown below may help you.
http://www.acm.org/crossroads/columns/ovp/march2001.html
Read this article till the end.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, let us know if you have a specific question we can help with. Meanwhile, example for file I/O can be found here, database access is explained here, and JavaMail tutorials can be found here.
 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a resultset.I want to write each line in resultset into text file which I generated. I am confusing I/O streams.can anybody send sample code.
 
Anupam Bhatt
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dearest Rajareddy,

If you are expecting a line by line code, i am afraid you would not get much help.

It is you who has to try it.
Please post any specific questions you have on I/O streams, or tell us about what are you "confused about".

What is the problem area?

Is it:
1. Getting the data from the database.
2. writing it to a file
3. or sending an email with an attachment.

And tell us what exactly is that is not working for you.

Thanks.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We love code that almost works. Do you have a small chunk that illustrates what doesn't quite do what you want?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!