日期:2014-05-17 浏览次数:20968 次
public class SendMailThread extends Thread {
private boolean enab = true;
private int cnts = 0;
private long sleepTimes = 0L;
private int sendindex = 1;
private final Log log = LogFactory.getLog(getClass());
private EmailDao<Temail> emailDao;
public EmailDao<Temail> getEmailDao() {
return emailDao;
}
@Autowired
public void setEmailDao(EmailDao<Temail> emailDao) {
this.emailDao = emailDao;
}
//设定线程是否停止
public void setEnab(boolean enab) {
this.enab = enab;
}
public int getCnts(){
return this.cnts;
}
public void run() {
try {
Iterator iterator1 = emailDao.executeSql("SELECT b.qqnum FROM paipaihelper.tremail a join paipaihelper.tremailmx b on a.id=b.pid where b.enab='Y'").iterator();
while (iterator1.hasNext()) {
System.out.println(iterator1.next().toString());
}
} catch (InterruptedException e) {
log.error("ss", e);
}
}
}