Solved

Multi threaded mailing application

Posted on 2004-09-27
6
180 Views
Last Modified: 2010-03-31
Dear All

I am supposed to develop a Multi Threaded mailing application in java. It has function as mentioned below:

There will be a thread which will scan the table in a database for the records having the status as Pending. Suppose the query returns 100 records. Each record contains an email id.Then first 15 records will be fetched in a Vector. Now 3 threads will be spawned. Each thread will work on 5 records. The 1st thread will send mail to  the email id of those 5 records.  2nd thread will send mail to  the email id of next 5 records and so on. Once the mail has been sent to 15 mail ids corresponding to 15 records, the status of those 15 records will be updated to Success in database.

This process will continue till all the records have been processed.

Can somebody help me in this application. I am not good at using threads.

Warm Regards

U can reach out to me at nikhil.bansal@tcs.com

Nikhil
0
Comment
Question by:nikhilbansal
  • 3
6 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 250 total points
ID: 12159832
Why do you need three more threads to send the messages? Just one separate thread will do as well.
0
 
LVL 35

Expert Comment

by:girionis
ID: 12159843
For a tutorial have a look here: http://www.didimusic.gr/
0
 
LVL 35

Expert Comment

by:girionis
ID: 12159852
0
 
LVL 12

Assisted Solution

by:Giant2
Giant2 earned 250 total points
ID: 12160315
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now