使用Spring提供Quartz來實現定時任務

2021-09-22 06:30:13 字數 1222 閱讀 5105

spring功能越來越多了,用起來還很舒服方便,quartz實現的定時任務就是乙個。

首先是配置檔案:

<?xml version="1.0" encoding="utf-8"?>

0 10 13 ? * mon

smtp.163.com

[email protected]

puzzle

[email protected]

[email protected],[email protected]

[email protected],[email protected]

[email protected],[email protected]

下面是com.ibm.***.service.auto.autoclaimremindermailservice類:

");    

sendmail(title,sb.tostring());

}protected string smtpserver;

protected string smtpusername;

protected string smtppassword;

protected string frommailaddress;

protected string tomailaddress;

protected string ccmailaddress;

protected string bccmailaddress;

/*** 無參建構函式

*/public autoclaimremindermailservice()

/*** 傳送郵件的關鍵函式

* * @param title

* @param content

* @return

* @throws exception

*/protected boolean sendmail(string title,string content) throws exception

protected internetaddress getinternetaddressarr(string mialaddr) throws exception{

string arr=mialaddr.split(",");

internetaddress retval=new internetaddress[arr.length];

for(int i=0;i

就到這裡,再見吧。

Spring整合Dubbo對外提供服務

1.新增依賴 dubbox compile group com.alibaba name dubbo version 2.5.3 compile io.netty netty 3.7.0.final zookeeper客戶端 compile com.github.sgroschupf zkclien...

spring提供的解決中文亂碼方案

在表單提交時,如果遇到中文符號會出現亂碼問題。spring提供乙個characterencodingfilter過濾器,可用於解決亂碼問題。characterencodingfilter使用的時候要注意以下問題 1.表單資料以post提交 2.在web.xml中配置characterencoding...

Spring提供了編寫DAO的支援類

1 daosupport 類 jdbcdaosupport hibernatedaosupport 自己寫的 dao按使用的訪問技術,有選擇的 繼承它們 類似於以前寫的basedao 類 2 template 類 jdbctemplate hibernatetemplate 封裝了通用操作,如 增刪...