aspose file tools
The moose likes Java in General and the fly likes Is there any way to send the contents of a resultset to a mail using javamail Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Is there any way to send the contents of a resultset to a mail using javamail" Watch "Is there any way to send the contents of a resultset to a mail using javamail" New topic
Author

Is there any way to send the contents of a resultset to a mail using javamail

sameer chandra vogeti
Greenhorn

Joined: Jan 31, 2008
Posts: 12
Hi,

Currently my application requires to send out mail's at regular intervals and it fetches data from a DB using Plain JDBC,is there any method through which i can export the content's of a resultset to a mail and send it across to required people.

Please help
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

A ResultSet doesn't have any "contents". However it is possible to read all of the records which it manifests, and I am sure you have seen code which does that. So read all of the records and format them into text in a way which is suitable for e-mailing. Then send that text.
sameer chandra vogeti
Greenhorn

Joined: Jan 31, 2008
Posts: 12
Any sample code for that as i am new to java development.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

Sample code for what? Extracting data from a ResultSet? Read any JDBC tutorial. Sending e-mail? Have a look at the sample programs in your JavaMail download.
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12907
    
    3

JDBC tutorial
Fundamentals of the JavaMail API


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Is there any way to send the contents of a resultset to a mail using javamail
 
Similar Threads
How can I transfer Image between client and server side in RMI
can java mail api use HTTP protocol
steps to send a mail using JAVA API
Outlook Meeting Request via Java API?
Email Host Configuration Problem