资源简介

spring-boot 2.0.2.RELEASE,将定时任务配置在数据库,启动项目的时候,用mybatis读取数据库,实例化对象,并设定定时任务。如果需要新增,减少,修改定时任务,仅需要修改数据库资料,并重启项目即可,无需改代码。含数据库建表语句和示范,运行application启动定时任务,测试类示范查看,修改定时任务。

资源截图

代码片段和文件信息

package com.example;

//import com.example.util.MyEnvironmentAware;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.Resource;


@EnableScheduling
@SpringBootApplication
@ComponentScan(“com.example.*“)
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class args);
    }

}



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        861  2018-07-27 09:41  SpringBoot-ScheduledTask-With-Database\.idea\compiler.xml

     文件        172  2018-07-27 09:41  SpringBoot-ScheduledTask-With-Database\.idea\encodings.xml

     文件        568  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__ch_qos_logback_logback_classic_1_2_3.xml

     文件        547  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__ch_qos_logback_logback_core_1_2_3.xml

     文件        493  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__com_alibaba_druid_1_1_10.xml

     文件        633  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__com_alibaba_druid_spring_boot_starter_1_1_10.xml

     文件        514  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__com_alibaba_fastjson_1_2_47.xml

     文件        546  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__com_jayway_jsonpath_json_path_2_4_0.xml

     文件        700  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml

     文件        503  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__com_zaxxer_HikariCP_2_7_9.xml

     文件        611  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__javax_annotation_javax_annotation_api_1_3_2.xml

     文件        455  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__junit_junit_4_12.xml

     文件        574  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_46.xml

     文件        536  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__net_bytebuddy_byte_buddy_1_7_11.xml

     文件        578  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__net_bytebuddy_byte_buddy_agent_1_7_11.xml

     文件        556  2018-07-27 13:17  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_apache_commons_commons_lang3_3_7.xml

     文件        573  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_apache_logging_log4j_log4j_api_2_10_0.xml

     文件        608  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_apache_logging_log4j_log4j_to_slf4j_2_10_0.xml

     文件        535  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_assertj_assertj_core_3_9_1.xml

     文件        532  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xml

     文件        553  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_hamcrest_hamcrest_library_1_3.xml

     文件        542  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_mockito_mockito_core_2_15_0.xml

     文件        500  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_mybatis_mybatis_3_4_6.xml

     文件        549  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_mybatis_mybatis_spring_1_3_2.xml

     文件        730  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_2.xml

     文件        688  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_2.xml

     文件        508  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_objenesis_objenesis_2_6.xml

     文件        537  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_skyscreamer_jsonassert_1_5_0.xml

     文件        534  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_slf4j_jul_to_slf4j_1_7_25.xml

     文件        506  2018-07-27 10:30  SpringBoot-ScheduledTask-With-Database\.idea\libraries\Maven__org_slf4j_slf4j_api_1_7_7.xml

............此处省略64个文件信息

评论

共有 条评论