60 lines
1.4 KiB
Java
60 lines
1.4 KiB
Java
package com.demo.util;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
import org.quartz.Job;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Configurable;
|
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import com.demo.service.CompareTwoTables;
|
|
|
|
@Component
|
|
public class MigrationJob extends QuartzJobBean {
|
|
|
|
//
|
|
@Autowired
|
|
CompareTwoTables service;
|
|
|
|
@Override
|
|
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
try {
|
|
service.jobStart();
|
|
} catch (ClassNotFoundException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
} catch (SQLException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
|
|
}
|
|
|
|
// public void execute(JobExecutionContext context)
|
|
// throws JobExecutionException {
|
|
//
|
|
// System.out.println("-----------------MigrationJob-------------------");
|
|
//
|
|
//
|
|
// try {
|
|
// service.jobStart();
|
|
// } catch (ClassNotFoundException e) {
|
|
// // TODO Auto-generated catch block
|
|
// e.printStackTrace();
|
|
// } catch (SQLException e) {
|
|
// // TODO Auto-generated catch block
|
|
// e.printStackTrace();
|
|
// }
|
|
//
|
|
//
|
|
// }
|
|
|
|
}
|