干吗要用quartz这大东西,最简单的用线程或者java.util.Timer就可以了。 Timer timer = new Timer(); timer.schedule(new TestThread(), waitTime, periodTime); public class SendEmailThread extends TimerTask { public SendEmailThread() { super(); } }
public class ClearNote extends Thread{ public ClearNote(){ this.start(); } public void run(){ try{ //关键代码不说出来了 for(;;) { sta.executeUpdate(sql); //sleep(1000*60*60*24); sleep(1000*10); }
Timer timer = new Timer();
timer.schedule(new TestThread(), waitTime, periodTime);
public class SendEmailThread extends TimerTask {
public SendEmailThread() {
super();
}
}
public ClearNote(){
this.start();
}
public void run(){
try{
//关键代码不说出来了
for(;;)
{
sta.executeUpdate(sql);
//sleep(1000*60*60*24);
sleep(1000*10);
}
}catch(Exception e){
System.out.println(e);
}
}
public static void main(String[] sssss){
ClearNote cn=new ClearNote();
}
}
网上看见的代码 谁能给完善下 说加上注释 线程方面我没用过 暂时还不会 呵呵~
http://fulong258.blog.163.com/blog/static/1789504420071126102524419/
不懂的地方单独觅我~ 41579564
你博客这部分代码能贴上来吗 你说只提供了部分代码,我想要全的