Dear All,
I am using an adapted code from the web for sending sms via gsm modem. Now I would like to modify to read sms message from database table and send it.So I would like to programme it to read on every 30 second from the db process and send the message. What will be best method is it timer or cronjob? Thank you.
newbie14
0
Posting Pro
Recommended Answers
Jump to Postcronjob is Unix related
java System.currentTimeMillis(); will give you the actual time in millis
Jump to PostThe normal way to run a method every 30 secs is to use a java Timer.
See the API docs for java.util.Timer (not javax.swing.Timer) for details, or example here:
http://www.exampledepot.com/egs/java.util/ScheduleRepeat.html
Jump to Postpublic void run() {
t1.sendMessage(phoneNumber,messageSend);
}
All 12 Replies
pbl
22
Junior Poster
newbie14
0
Posting Pro
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
newbie14
0
Posting Pro
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
newbie14
0
Posting Pro
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
newbie14
0
Posting Pro
purijatin
0
Light Poster
purijatin
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
newbie14
0
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.