?
Solved

Quartz JDBCJobStore implementation referencing the user accounts in the main application's Java DB table?

Posted on 2011-10-22
10
Medium Priority
?
258 Views
Last Modified: 2012-05-12
I'm planning on using Quartz JDBCJobStore task scheduler! I read the tutorials but I still can't tell how I would be able to use this in conjunction with my embedded Java DB database. I need the task scheduler to have a foreign key referencing my user account table since in my application tasks are associated with each and individual users. How do you think I can pull the operation off with JDBCJobStore?? Supplying sample code would be grately appreciated!

I basically want the user to be able to set hourly, weekly or monthly tasks for certain queries to run and store the resultSets, sending them to a specific location!

If you could recommend easier alternatives, I would also be interested to know about it!

Thanks
0
Comment
Question by:snajalm
  • 5
  • 5
10 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 37011243
What is your operating system and how often you will be running your queries?
How long runs each query?
I'm asking for the ballpark numbers - just orders of magnitude.
0
 

Author Comment

by:snajalm
ID: 37011646
This application would have to be operated on both Windows and Mac environments and is a reporting software.  The queries will run of a different server and the results are saved as XML and later sent to another server!  There could be queries of different sizes and magnitudes, depending on the user database and number of users running schedules on this application!
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37011657
so you think that it would be an application which user can launch specifying their own type of schedule each time, and each user may want to run them
at different times and on different schedules? So that it would not be something which would constantly be running on particular machine all the time in the same way?
Yes, maybe for such situation Quartz would be a good idea.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:snajalm
ID: 37011678
Yes, it's not a set or known schedule!  The application would need to act dynamically in a way that each user would need to set schedules based on their preference and these information would need to be stored in the application database to be used later on even after the application shuts down and comes back up.  Have you used Quartz??!  If so, how would I be able to integrate quartz with my application database.  I need this because each schedule should be associated with a single user!
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37011710

Unfortunately I haven't used Quartz
But have you looked at Timer and TimeTask classes of Java standard library:

http://download.oracle.com/javase/6/docs/api/javax/swing/Timer.html

Is there  something which you need beyond that?
0
 

Author Comment

by:snajalm
ID: 37011737
I basically want to give my users three options of setting up their scheduled task,

Hourly - Daily - Monthly

The user will choose the starting time and date which would naturally be updated as a field in the (let's say Schedules) database and from that time the application should work out when to run the task associated with that specific user.  For instance if Hourly, then it should wake up every hour and run the related tasks.  It should be very difficult and complicated scheduling system at all.  

My challenge would obviously be to keep checking the database or have the times copied to connection objects at startup and making sure the tasks are run according to their user defined schedules!
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37011772
I think this Timer class should allow you to do this stuff.So you'll run this application all the time have some GUI where users would specify there
schedules and you'll start running them at the specified times and also store in database.
But I'd think you need to store in databse only for the case when your application gets restarted - then you read all stored schedules
and restrta your activities accordinly - you woul not need to check the database all the time as
long as your application is running and keeping them in memory.
Don't know maybe Quartz will offer some additional conveniences but Timer seems to allow to do
the basic scheduleing similar to tha one which say Windows scheduler provides.
0
 
LVL 47

Accepted Solution

by:
for_yan earned 1500 total points
ID: 37013210

I actually tried these Timer and TimerTask classes.
They seem to be working as expected - I scheduled
10 tasks, started them with the interval of 10 sec
and requested each of them to repeat every 3 seconds.
It seem to be working as expected (see code and output below), and
as I understand they can also be scheduled for bigger time sclale
 - like days and weeks



import java.util.Timer;
import java.util.TimerTask;

public class TimerTest {

    public static void main(String[] args) {
         java.util.Date dd = new java.util.Date();

        Timer myTimer = new Timer();

        for(int j=0; j<10; j++){
            java.util.Date curDate = new java.util.Date(dd.getTime() + (j+1)*10000L);
              myTimer.schedule(new MyTask(j), curDate, 3000L);

        }
        
    }

}
class MyTask extends TimerTask {
    int myNum;
    int executionTime = 1;
    public MyTask(int n){
        myNum = n;
    }

public void run(){
    System.out.println((new java.util.Date()) + ":  Hello, my task number is " + myNum + " Im running now for the " + executionTime + " th time");
       executionTime++;
}


}

Open in new window


Output:
Sat Oct 22 22:54:38 PDT 2011:  Hello, my task number is 0 Im running now for the 1 th time
Sat Oct 22 22:54:41 PDT 2011:  Hello, my task number is 0 Im running now for the 2 th time
Sat Oct 22 22:54:44 PDT 2011:  Hello, my task number is 0 Im running now for the 3 th time
Sat Oct 22 22:54:47 PDT 2011:  Hello, my task number is 0 Im running now for the 4 th time
Sat Oct 22 22:54:48 PDT 2011:  Hello, my task number is 1 Im running now for the 1 th time
Sat Oct 22 22:54:50 PDT 2011:  Hello, my task number is 0 Im running now for the 5 th time
Sat Oct 22 22:54:51 PDT 2011:  Hello, my task number is 1 Im running now for the 2 th time
Sat Oct 22 22:54:53 PDT 2011:  Hello, my task number is 0 Im running now for the 6 th time
Sat Oct 22 22:54:54 PDT 2011:  Hello, my task number is 1 Im running now for the 3 th time
Sat Oct 22 22:54:56 PDT 2011:  Hello, my task number is 0 Im running now for the 7 th time
Sat Oct 22 22:54:57 PDT 2011:  Hello, my task number is 1 Im running now for the 4 th time
Sat Oct 22 22:54:58 PDT 2011:  Hello, my task number is 2 Im running now for the 1 th time
Sat Oct 22 22:54:59 PDT 2011:  Hello, my task number is 0 Im running now for the 8 th time
Sat Oct 22 22:55:00 PDT 2011:  Hello, my task number is 1 Im running now for the 5 th time
Sat Oct 22 22:55:01 PDT 2011:  Hello, my task number is 2 Im running now for the 2 th time
Sat Oct 22 22:55:02 PDT 2011:  Hello, my task number is 0 Im running now for the 9 th time
Sat Oct 22 22:55:03 PDT 2011:  Hello, my task number is 1 Im running now for the 6 th time
Sat Oct 22 22:55:04 PDT 2011:  Hello, my task number is 2 Im running now for the 3 th time
Sat Oct 22 22:55:05 PDT 2011:  Hello, my task number is 0 Im running now for the 10 th time
Sat Oct 22 22:55:06 PDT 2011:  Hello, my task number is 1 Im running now for the 7 th time
Sat Oct 22 22:55:07 PDT 2011:  Hello, my task number is 2 Im running now for the 4 th time
Sat Oct 22 22:55:08 PDT 2011:  Hello, my task number is 3 Im running now for the 1 th time
Sat Oct 22 22:55:08 PDT 2011:  Hello, my task number is 0 Im running now for the 11 th time
Sat Oct 22 22:55:09 PDT 2011:  Hello, my task number is 1 Im running now for the 8 th time
Sat Oct 22 22:55:10 PDT 2011:  Hello, my task number is 2 Im running now for the 5 th time
Sat Oct 22 22:55:11 PDT 2011:  Hello, my task number is 0 Im running now for the 12 th time
Sat Oct 22 22:55:11 PDT 2011:  Hello, my task number is 3 Im running now for the 2 th time
Sat Oct 22 22:55:12 PDT 2011:  Hello, my task number is 1 Im running now for the 9 th time
Sat Oct 22 22:55:13 PDT 2011:  Hello, my task number is 2 Im running now for the 6 th time
Sat Oct 22 22:55:14 PDT 2011:  Hello, my task number is 3 Im running now for the 3 th time
Sat Oct 22 22:55:14 PDT 2011:  Hello, my task number is 0 Im running now for the 13 th time
Sat Oct 22 22:55:15 PDT 2011:  Hello, my task number is 1 Im running now for the 10 th time
Sat Oct 22 22:55:16 PDT 2011:  Hello, my task number is 2 Im running now for the 7 th time
Sat Oct 22 22:55:17 PDT 2011:  Hello, my task number is 0 Im running now for the 14 th time
Sat Oct 22 22:55:17 PDT 2011:  Hello, my task number is 3 Im running now for the 4 th time
Sat Oct 22 22:55:18 PDT 2011:  Hello, my task number is 4 Im running now for the 1 th time
Sat Oct 22 22:55:18 PDT 2011:  Hello, my task number is 1 Im running now for the 11 th time
Sat Oct 22 22:55:19 PDT 2011:  Hello, my task number is 2 Im running now for the 8 th time
Sat Oct 22 22:55:20 PDT 2011:  Hello, my task number is 3 Im running now for the 5 th time
Sat Oct 22 22:55:20 PDT 2011:  Hello, my task number is 0 Im running now for the 15 th time
Sat Oct 22 22:55:21 PDT 2011:  Hello, my task number is 1 Im running now for the 12 th time
Sat Oct 22 22:55:21 PDT 2011:  Hello, my task number is 4 Im running now for the 2 th time
Sat Oct 22 22:55:22 PDT 2011:  Hello, my task number is 2 Im running now for the 9 th time
Sat Oct 22 22:55:23 PDT 2011:  Hello, my task number is 0 Im running now for the 16 th time
Sat Oct 22 22:55:23 PDT 2011:  Hello, my task number is 3 Im running now for the 6 th time
Sat Oct 22 22:55:24 PDT 2011:  Hello, my task number is 1 Im running now for the 13 th time
Sat Oct 22 22:55:24 PDT 2011:  Hello, my task number is 4 Im running now for the 3 th time
Sat Oct 22 22:55:25 PDT 2011:  Hello, my task number is 2 Im running now for the 10 th time
Sat Oct 22 22:55:26 PDT 2011:  Hello, my task number is 3 Im running now for the 7 th time
Sat Oct 22 22:55:26 PDT 2011:  Hello, my task number is 0 Im running now for the 17 th time
Sat Oct 22 22:55:27 PDT 2011:  Hello, my task number is 1 Im running now for the 14 th time
Sat Oct 22 22:55:27 PDT 2011:  Hello, my task number is 4 Im running now for the 4 th time
Sat Oct 22 22:55:28 PDT 2011:  Hello, my task number is 5 Im running now for the 1 th time
Sat Oct 22 22:55:28 PDT 2011:  Hello, my task number is 2 Im running now for the 11 th time
Sat Oct 22 22:55:29 PDT 2011:  Hello, my task number is 0 Im running now for the 18 th time
Sat Oct 22 22:55:29 PDT 2011:  Hello, my task number is 3 Im running now for the 8 th time
Sat Oct 22 22:55:30 PDT 2011:  Hello, my task number is 1 Im running now for the 15 th time
Sat Oct 22 22:55:30 PDT 2011:  Hello, my task number is 4 Im running now for the 5 th time
Sat Oct 22 22:55:31 PDT 2011:  Hello, my task number is 2 Im running now for the 12 th time
Sat Oct 22 22:55:31 PDT 2011:  Hello, my task number is 5 Im running now for the 2 th time
Sat Oct 22 22:55:32 PDT 2011:  Hello, my task number is 3 Im running now for the 9 th time
Sat Oct 22 22:55:32 PDT 2011:  Hello, my task number is 0 Im running now for the 19 th time
Sat Oct 22 22:55:33 PDT 2011:  Hello, my task number is 4 Im running now for the 6 th time
Sat Oct 22 22:55:33 PDT 2011:  Hello, my task number is 1 Im running now for the 16 th time
Sat Oct 22 22:55:34 PDT 2011:  Hello, my task number is 2 Im running now for the 13 th time
Sat Oct 22 22:55:34 PDT 2011:  Hello, my task number is 5 Im running now for the 3 th time
Sat Oct 22 22:55:35 PDT 2011:  Hello, my task number is 0 Im running now for the 20 th time
Sat Oct 22 22:55:35 PDT 2011:  Hello, my task number is 3 Im running now for the 10 th time
Sat Oct 22 22:55:36 PDT 2011:  Hello, my task number is 1 Im running now for the 17 th time
Sat Oct 22 22:55:36 PDT 2011:  Hello, my task number is 4 Im running now for the 7 th time
Sat Oct 22 22:55:37 PDT 2011:  Hello, my task number is 2 Im running now for the 14 th time
Sat Oct 22 22:55:37 PDT 2011:  Hello, my task number is 5 Im running now for the 4 th time
Sat Oct 22 22:55:38 PDT 2011:  Hello, my task number is 6 Im running now for the 1 th time
Sat Oct 22 22:55:38 PDT 2011:  Hello, my task number is 3 Im running now for the 11 th time
Sat Oct 22 22:55:38 PDT 2011:  Hello, my task number is 0 Im running now for the 21 th time
Sat Oct 22 22:55:39 PDT 2011:  Hello, my task number is 4 Im running now for the 8 th time
Sat Oct 22 22:55:39 PDT 2011:  Hello, my task number is 1 Im running now for the 18 th time
Sat Oct 22 22:55:40 PDT 2011:  Hello, my task number is 2 Im running now for the 15 th time
Sat Oct 22 22:55:40 PDT 2011:  Hello, my task number is 5 Im running now for the 5 th time
Sat Oct 22 22:55:41 PDT 2011:  Hello, my task number is 0 Im running now for the 22 th time
Sat Oct 22 22:55:41 PDT 2011:  Hello, my task number is 6 Im running now for the 2 th time
Sat Oct 22 22:55:41 PDT 2011:  Hello, my task number is 3 Im running now for the 12 th time
Sat Oct 22 22:55:42 PDT 2011:  Hello, my task number is 1 Im running now for the 19 th time
Sat Oct 22 22:55:42 PDT 2011:  Hello, my task number is 4 Im running now for the 9 th time
Sat Oct 22 22:55:43 PDT 2011:  Hello, my task number is 5 Im running now for the 6 th time
Sat Oct 22 22:55:43 PDT 2011:  Hello, my task number is 2 Im running now for the 16 th time
Sat Oct 22 22:55:44 PDT 2011:  Hello, my task number is 0 Im running now for the 23 th time
Sat Oct 22 22:55:44 PDT 2011:  Hello, my task number is 3 Im running now for the 13 th time
Sat Oct 22 22:55:44 PDT 2011:  Hello, my task number is 6 Im running now for the 3 th time
Sat Oct 22 22:55:45 PDT 2011:  Hello, my task number is 4 Im running now for the 10 th time
Sat Oct 22 22:55:45 PDT 2011:  Hello, my task number is 1 Im running now for the 20 th time
Sat Oct 22 22:55:46 PDT 2011:  Hello, my task number is 2 Im running now for the 17 th time
Sat Oct 22 22:55:46 PDT 2011:  Hello, my task number is 5 Im running now for the 7 th time
Sat Oct 22 22:55:47 PDT 2011:  Hello, my task number is 0 Im running now for the 24 th time
Sat Oct 22 22:55:47 PDT 2011:  Hello, my task number is 6 Im running now for the 4 th time
Sat Oct 22 22:55:47 PDT 2011:  Hello, my task number is 3 Im running now for the 14 th time
Sat Oct 22 22:55:48 PDT 2011:  Hello, my task number is 7 Im running now for the 1 th time
Sat Oct 22 22:55:48 PDT 2011:  Hello, my task number is 1 Im running now for the 21 th time
Sat Oct 22 22:55:48 PDT 2011:  Hello, my task number is 4 Im running now for the 11 th time
Sat Oct 22 22:55:49 PDT 2011:  Hello, my task number is 5 Im running now for the 8 th time
Sat Oct 22 22:55:49 PDT 2011:  Hello, my task number is 2 Im running now for the 18 th time
Sat Oct 22 22:55:50 PDT 2011:  Hello, my task number is 3 Im running now for the 15 th time
Sat Oct 22 22:55:50 PDT 2011:  Hello, my task number is 0 Im running now for the 25 th time
Sat Oct 22 22:55:50 PDT 2011:  Hello, my task number is 6 Im running now for the 5 th time
Sat Oct 22 22:55:51 PDT 2011:  Hello, my task number is 7 Im running now for the 2 th time
Sat Oct 22 22:55:51 PDT 2011:  Hello, my task number is 4 Im running now for the 12 th time
Sat Oct 22 22:55:51 PDT 2011:  Hello, my task number is 1 Im running now for the 22 th time
Sat Oct 22 22:55:52 PDT 2011:  Hello, my task number is 2 Im running now for the 19 th time
Sat Oct 22 22:55:52 PDT 2011:  Hello, my task number is 5 Im running now for the 9 th time
Sat Oct 22 22:55:53 PDT 2011:  Hello, my task number is 6 Im running now for the 6 th time
Sat Oct 22 22:55:53 PDT 2011:  Hello, my task number is 3 Im running now for the 16 th time
Sat Oct 22 22:55:53 PDT 2011:  Hello, my task number is 0 Im running now for the 26 th time
Sat Oct 22 22:55:54 PDT 2011:  Hello, my task number is 7 Im running now for the 3 th time
Sat Oct 22 22:55:54 PDT 2011:  Hello, my task number is 1 Im running now for the 23 th time
Sat Oct 22 22:55:54 PDT 2011:  Hello, my task number is 4 Im running now for the 13 th time
Sat Oct 22 22:55:55 PDT 2011:  Hello, my task number is 5 Im running now for the 10 th time
Sat Oct 22 22:55:55 PDT 2011:  Hello, my task number is 2 Im running now for the 20 th time
Sat Oct 22 22:55:56 PDT 2011:  Hello, my task number is 0 Im running now for the 27 th time
Sat Oct 22 22:55:56 PDT 2011:  Hello, my task number is 6 Im running now for the 7 th time
Sat Oct 22 22:55:56 PDT 2011:  Hello, my task number is 3 Im running now for the 17 th time
Sat Oct 22 22:55:57 PDT 2011:  Hello, my task number is 7 Im running now for the 4 th time
Sat Oct 22 22:55:57 PDT 2011:  Hello, my task number is 4 Im running now for the 14 th time
Sat Oct 22 22:55:57 PDT 2011:  Hello, my task number is 1 Im running now for the 24 th time
Sat Oct 22 22:55:58 PDT 2011:  Hello, my task number is 8 Im running now for the 1 th time
Sat Oct 22 22:55:58 PDT 2011:  Hello, my task number is 2 Im running now for the 21 th time
Sat Oct 22 22:55:58 PDT 2011:  Hello, my task number is 5 Im running now for the 11 th time
Sat Oct 22 22:55:59 PDT 2011:  Hello, my task number is 3 Im running now for the 18 th time
Sat Oct 22 22:55:59 PDT 2011:  Hello, my task number is 0 Im running now for the 28 th time
Sat Oct 22 22:55:59 PDT 2011:  Hello, my task number is 6 Im running now for the 8 th time
Sat Oct 22 22:56:00 PDT 2011:  Hello, my task number is 7 Im running now for the 5 th time
Sat Oct 22 22:56:00 PDT 2011:  Hello, my task number is 1 Im running now for the 25 th time
Sat Oct 22 22:56:00 PDT 2011:  Hello, my task number is 4 Im running now for the 15 th time
Sat Oct 22 22:56:01 PDT 2011:  Hello, my task number is 8 Im running now for the 2 th time
Sat Oct 22 22:56:01 PDT 2011:  Hello, my task number is 5 Im running now for the 12 th time
Sat Oct 22 22:56:01 PDT 2011:  Hello, my task number is 2 Im running now for the 22 th time
Sat Oct 22 22:56:02 PDT 2011:  Hello, my task number is 6 Im running now for the 9 th time
Sat Oct 22 22:56:02 PDT 2011:  Hello, my task number is 3 Im running now for the 19 th time
Sat Oct 22 22:56:02 PDT 2011:  Hello, my task number is 0 Im running now for the 29 th time
Sat Oct 22 22:56:03 PDT 2011:  Hello, my task number is 7 Im running now for the 6 th time
Sat Oct 22 22:56:03 PDT 2011:  Hello, my task number is 4 Im running now for the 16 th time
Sat Oct 22 22:56:03 PDT 2011:  Hello, my task number is 1 Im running now for the 26 th time
Sat Oct 22 22:56:04 PDT 2011:  Hello, my task number is 8 Im running now for the 3 th time
Sat Oct 22 22:56:04 PDT 2011:  Hello, my task number is 2 Im running now for the 23 th time
Sat Oct 22 22:56:04 PDT 2011:  Hello, my task number is 5 Im running now for the 13 th time
Sat Oct 22 22:56:05 PDT 2011:  Hello, my task number is 6 Im running now for the 10 th time
Sat Oct 22 22:56:05 PDT 2011:  Hello, my task number is 0 Im running now for the 30 th time
Sat Oct 22 22:56:05 PDT 2011:  Hello, my task number is 3 Im running now for the 20 th time
Sat Oct 22 22:56:06 PDT 2011:  Hello, my task number is 7 Im running now for the 7 th time
Sat Oct 22 22:56:06 PDT 2011:  Hello, my task number is 1 Im running now for the 27 th time
Sat Oct 22 22:56:06 PDT 2011:  Hello, my task number is 4 Im running now for the 17 th time
Sat Oct 22 22:56:07 PDT 2011:  Hello, my task number is 8 Im running now for the 4 th time
Sat Oct 22 22:56:07 PDT 2011:  Hello, my task number is 5 Im running now for the 14 th time
Sat Oct 22 22:56:07 PDT 2011:  Hello, my task number is 2 Im running now for the 24 th time
Sat Oct 22 22:56:08 PDT 2011:  Hello, my task number is 9 Im running now for the 1 th time
Sat Oct 22 22:56:08 PDT 2011:  Hello, my task number is 3 Im running now for the 21 th time
Sat Oct 22 22:56:08 PDT 2011:  Hello, my task number is 6 Im running now for the 11 th time
Sat Oct 22 22:56:08 PDT 2011:  Hello, my task number is 0 Im running now for the 31 th time
Sat Oct 22 22:56:09 PDT 2011:  Hello, my task number is 7 Im running now for the 8 th time
Sat Oct 22 22:56:09 PDT 2011:  Hello, my task number is 4 Im running now for the 18 th time
Sat Oct 22 22:56:09 PDT 2011:  Hello, my task number is 1 Im running now for the 28 th time
Sat Oct 22 22:56:10 PDT 2011:  Hello, my task number is 8 Im running now for the 5 th time
Sat Oct 22 22:56:10 PDT 2011:  Hello, my task number is 2 Im running now for the 25 th time
Sat Oct 22 22:56:10 PDT 2011:  Hello, my task number is 5 Im running now for the 15 th time
Sat Oct 22 22:56:11 PDT 2011:  Hello, my task number is 9 Im running now for the 2 th time
Sat Oct 22 22:56:11 PDT 2011:  Hello, my task number is 3 Im running now for the 22 th time
Sat Oct 22 22:56:11 PDT 2011:  Hello, my task number is 0 Im running now for the 32 th time
Sat Oct 22 22:56:11 PDT 2011:  Hello, my task number is 6 Im running now for the 12 th time
Sat Oct 22 22:56:12 PDT 2011:  Hello, my task number is 7 Im running now for the 9 th time
Sat Oct 22 22:56:12 PDT 2011:  Hello, my task number is 1 Im running now for the 29 th time
Sat Oct 22 22:56:12 PDT 2011:  Hello, my task number is 4 Im running now for the 19 th time
Sat Oct 22 22:56:13 PDT 2011:  Hello, my task number is 8 Im running now for the 6 th time
Sat Oct 22 22:56:13 PDT 2011:  Hello, my task number is 5 Im running now for the 16 th time
Sat Oct 22 22:56:13 PDT 2011:  Hello, my task number is 2 Im running now for the 26 th time
Sat Oct 22 22:56:14 PDT 2011:  Hello, my task number is 9 Im running now for the 3 th time
Sat Oct 22 22:56:14 PDT 2011:  Hello, my task number is 6 Im running now for the 13 th time
Sat Oct 22 22:56:14 PDT 2011:  Hello, my task number is 3 Im running now for the 23 th time
Sat Oct 22 22:56:14 PDT 2011:  Hello, my task number is 0 Im running now for the 33 th time
Sat Oct 22 22:56:15 PDT 2011:  Hello, my task number is 7 Im running now for the 10 th time
Sat Oct 22 22:56:15 PDT 2011:  Hello, my task number is 4 Im running now for the 20 th time
Sat Oct 22 22:56:15 PDT 2011:  Hello, my task number is 1 Im running now for the 30 th time
Sat Oct 22 22:56:16 PDT 2011:  Hello, my task number is 8 Im running now for the 7 th time
Sat Oct 22 22:56:16 PDT 2011:  Hello, my task number is 2 Im running now for the 27 th time
Sat Oct 22 22:56:16 PDT 2011:  Hello, my task number is 5 Im running now for the 17 th time
Sat Oct 22 22:56:17 PDT 2011:  Hello, my task number is 9 Im running now for the 4 th time
Sat Oct 22 22:56:17 PDT 2011:  Hello, my task number is 0 Im running now for the 34 th time
Sat Oct 22 22:56:17 PDT 2011:  Hello, my task number is 6 Im running now for the 14 th time
Sat Oct 22 22:56:17 PDT 2011:  Hello, my task number is 3 Im running now for the 24 th time
Sat Oct 22 22:56:18 PDT 2011:  Hello, my task number is 7 Im running now for the 11 th time
Sat Oct 22 22:56:18 PDT 2011:  Hello, my task number is 1 Im running now for the 31 th time
Sat Oct 22 22:56:18 PDT 2011:  Hello, my task number is 4 Im running now for the 21 th time
Sat Oct 22 22:56:19 PDT 2011:  Hello, my task number is 8 Im running now for the 8 th time
Sat Oct 22 22:56:19 PDT 2011:  Hello, my task number is 5 Im running now for the 18 th time
Sat Oct 22 22:56:19 PDT 2011:  Hello, my task number is 2 Im running now for the 28 th time
Sat Oct 22 22:56:20 PDT 2011:  Hello, my task number is 9 Im running now for the 5 th time
Sat Oct 22 22:56:20 PDT 2011:  Hello, my task number is 3 Im running now for the 25 th time
Sat Oct 22 22:56:20 PDT 2011:  Hello, my task number is 0 Im running now for the 35 th time
Sat Oct 22 22:56:20 PDT 2011:  Hello, my task number is 6 Im running now for the 15 th time

Open in new window

0
 

Author Comment

by:snajalm
ID: 37048939
Thanks for_yar, however, I would like to have a situation when I can define my tasks in three ways

Hourly -> start an an specific date, end at an specific date and repeat every once an hour until reaching the end date
Daily -> start at an specific date, end at an specific date and repeat once a day or two times a day
Weekly -> start at an specific date, end at an specific and repeat once a week or every 2, 3, 4, ... weeks

Can we modify the above code so we could come up with that.  It seems that Timer class has been improved in the lastes tversion of Java!
0
 

Author Closing Comment

by:snajalm
ID: 37691386
Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month16 days, 21 hours left to enroll

864 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