데이터베이스 트리거(Database Trigger)는 테이블에 대한 이벤트에 반응해 자동으로 실행되는 작업을 의미한다. 트리거는 데이터 조작 언어(DML)의 데이터 상태의 관리를 자동화하는 데 사용된다. 트리거를 사용하여 데이터 작업 제한, 작업 기록, 변경 작업 감사 등을 할 수 있다.
Quartz Trigger 종류
1) SimpleTrigger
2) CronTrigger
Field Name | Mandatory | Allowed Values | Allowed Special Characters |
---|---|---|---|
Seconds | YES | 0-59 | , - * / |
Minutes | YES | 0-59 | , - * / |
Hours | YES | 0-23 | , - * / |
Day of month | YES | 1-31 | , - * ? / L W |
Month | YES | 1-12 or JAN-DEC | , - * / |
Day of week | YES | 1-7 or SUN-SAT | , - * ? / L # |
Year | NO | empty, 1970-2099 | , - * / |
Expression | Meaning |
---|---|
0 0 12 * * ? | Fire at 12pm (noon) every day |
0 15 10 ? * * | Fire at 10:15am every day |
0 15 10 * * ? | Fire at 10:15am every day |
0 15 10 * * ? * | Fire at 10:15am every day |
0 15 10 * * ? 2005 | Fire at 10:15am every day during the year 2005 |
0 * 14 * * ? | Fire every minute starting at 2pm and ending at 2:59pm, every day |
0 0/5 14 * * ? | Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day |
0 0/5 14,18 * * ? | Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day |
0 0-5 14 * * ? | Fire every minute starting at 2pm and ending at 2:05pm, every day |
0 10,44 14 ? 3 WED | Fire at 2:10pm and at 2:44pm every Wednesday in the month of March. |
0 15 10 ? * MON-FRI | Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday |
0 15 10 15 * ? | Fire at 10:15am on the 15th day of every month |
0 15 10 L * ? | Fire at 10:15am on the last day of every month |
0 15 10 ? * 6L | Fire at 10:15am on the last Friday of every month |
0 15 10 ? * 6L | Fire at 10:15am on the last Friday of every month |
0 15 10 ? * 6L 2002-2005 | Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005 |
0 15 10 ? * 6#3 | Fire at 10:15am on the third Friday of every month |
0 0 12 1/5 * ? | Fire at 12pm (noon) every 5 days every month, starting on the first day of the month. |
0 11 11 11 11 ? | Fire every November 11th at 11:11am. |
org.quartz
Class TriggerBuilder<T extends Trigger>
java.lang.Object org.quartz.TriggerBuilder<T>
TriggerBuilder
is used to instantiate Trigger
s.
The builder will always try to keep itself in a valid state, with reasonable defaults set for calling build() at any point. For instance if you do not invoke withSchedule(..) method, a default schedule of firing once immediately will be used. As another example, if you do not invoked withIdentity(..) a trigger name will be generated for you.
Quartz provides a builder-style API for constructing scheduling-related entities via a Domain-Specific Language (DSL). The DSL can best be utilized through the usage of static imports of the methods on the classes TriggerBuilder
, JobBuilder
, DateBuilder
, JobKey
,TriggerKey
and the various ScheduleBuilder
implementations.
Client code can then use the DSL to write code such as this: |
JobDetail job = newJob(MyJob.class) .withIdentity("myJob") .build(); Trigger trigger = newTrigger() .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) .withSchedule(simpleSchedule() .withIntervalInHours(1) .repeatForever()) .startAt(futureDate(10, MINUTES)) .build();scheduler.scheduleJob(job, trigger); |
.withIdentity(String name, String group) | JobDetail 식별 [name:JobKey 이름 요소/ group:JobKey 그룹 요소] |
.withSchedule(ScheduleBuilder<SimpleTrigger> schedBuilder) | 트리거 일정 정의 |
.startAt(Date triggerStartTime) |
트리거 시작시간 설정 |
.build() |
JobDetail 인스턴스 생성 |
': IT' 카테고리의 다른 글
맥 터미널에서 Vue CLI, node, npm 설치된 버전 확인(mac os) (0) | 2021.08.27 |
---|---|
[AWS] AWS EC2 & EB 와 카페24 호스팅 (0) | 2020.09.10 |
[IntelliJ IDEA] 터미널에서 vue 프로젝트 생성 (0) | 2020.02.05 |
[Struts2] 변수설정 (0) | 2016.03.09 |
[SQL 에러] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near (0) | 2016.02.03 |