I m using @Scheduled in spring which will work fine if i want to execute task on evey 5 Second using @Scheduled(fixedRate = 5000) But I want to execute Job on 8:00 AM and 3:10 Pm Every Day which is not working. Following is My code.
@Component
public class FinanceJob {
@Autowired
AdminService adminService;
@Autowired
AdminDao dao;
@Autowired
CommonService cservice;
//@Scheduled(fixedRate = 5000)
// @Scheduled(cron = "0/20 * * * * ?")
@Scheduled(cron="0 48 2 * * *",zone = "Indian/Maldives")
public void sajan() {
List<SystemParameter> paramList=cservice.getSysParam();
for(SystemParameter param :paramList)
{
if(param.getUid()==263 && param.getIsactive()==1)
{
System.out.println("Hello Sahjan");
}
}
}
}