KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quartz > impl > jdbcjobstore > StdJDBCConstants


1 /*
2  * Copyright 2004-2005 OpenSymphony
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy
6  * of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations
14  * under the License.
15  *
16  */

17
18 /*
19  * Previously Copyright (c) 2001-2004 James House
20  */

21
22 package org.quartz.impl.jdbcjobstore;
23
24 /**
25  * <p>
26  * This interface extends <code>{@link
27  * org.quartz.impl.jdbcjobstore.Constants}</code>
28  * to include the query string constants in use by the <code>{@link
29  * org.quartz.impl.jdbcjobstore.StdJDBCDelegate}</code>
30  * class.
31  * </p>
32  *
33  * @author <a HREF="mailto:jeff@binaryfeed.org">Jeffrey Wescott</a>
34  */

35 public interface StdJDBCConstants extends Constants {
36
37     /*
38      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39      *
40      * Constants.
41      *
42      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43      */

44
45     // table prefix substitution string
46
String JavaDoc TABLE_PREFIX_SUBST = "{0}";
47
48     // QUERIES
49
String JavaDoc UPDATE_TRIGGER_STATES_FROM_OTHER_STATES = "UPDATE "
50             + TABLE_PREFIX_SUBST
51             + TABLE_TRIGGERS
52             + " SET "
53             + COL_TRIGGER_STATE
54             + " = ?"
55             + " WHERE "
56             + COL_TRIGGER_STATE
57             + " = ? OR "
58             + COL_TRIGGER_STATE + " = ?";
59
60     String JavaDoc UPDATE_TRIGGER_STATE_FROM_OTHER_STATES_BEFORE_TIME = "UPDATE "
61             + TABLE_PREFIX_SUBST
62             + TABLE_TRIGGERS
63             + " SET "
64             + COL_TRIGGER_STATE
65             + " = ?"
66             + " WHERE ("
67             + COL_TRIGGER_STATE
68             + " = ? OR "
69             + COL_TRIGGER_STATE + " = ?) AND " + COL_NEXT_FIRE_TIME + " < ?";
70
71     String JavaDoc SELECT_MISFIRED_TRIGGERS = "SELECT * FROM "
72             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
73             + COL_NEXT_FIRE_TIME + " < ? ORDER BY START_TIME ASC";
74
75     String JavaDoc SELECT_TRIGGERS_IN_STATE = "SELECT "
76             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
77             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
78             + COL_TRIGGER_STATE + " = ?";
79
80     String JavaDoc SELECT_MISFIRED_TRIGGERS_IN_STATE = "SELECT "
81             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
82             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
83             + COL_NEXT_FIRE_TIME + " < ? AND " + COL_TRIGGER_STATE + " = ?";
84
85     String JavaDoc COUNT_MISFIRED_TRIGGERS_IN_STATES = "SELECT COUNT("
86         + COL_TRIGGER_NAME + ") FROM "
87         + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
88         + COL_NEXT_FIRE_TIME + " < ? "
89         +"AND ((" + COL_TRIGGER_STATE + " = ?) OR (" + COL_TRIGGER_STATE + " = ?))";
90
91     String JavaDoc SELECT_MISFIRED_TRIGGERS_IN_STATES = "SELECT "
92         + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
93         + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
94         + COL_NEXT_FIRE_TIME + " < ? "
95         +"AND ((" + COL_TRIGGER_STATE + " = ?) OR (" + COL_TRIGGER_STATE + " = ?))";
96
97     String JavaDoc SELECT_MISFIRED_TRIGGERS_IN_GROUP_IN_STATE = "SELECT "
98             + COL_TRIGGER_NAME
99             + " FROM "
100             + TABLE_PREFIX_SUBST
101             + TABLE_TRIGGERS
102             + " WHERE "
103             + COL_NEXT_FIRE_TIME
104             + " < ? AND "
105             + COL_TRIGGER_GROUP
106             + " = ? AND " + COL_TRIGGER_STATE + " = ?";
107
108     String JavaDoc SELECT_VOLATILE_TRIGGERS = "SELECT "
109             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
110             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE " + COL_IS_VOLATILE
111             + " = ?";
112
113     String JavaDoc DELETE_FIRED_TRIGGERS = "DELETE FROM "
114             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS;
115
116     String JavaDoc INSERT_JOB_DETAIL = "INSERT INTO "
117             + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " (" + COL_JOB_NAME
118             + ", " + COL_JOB_GROUP + ", " + COL_DESCRIPTION + ", "
119             + COL_JOB_CLASS + ", " + COL_IS_DURABLE + ", " + COL_IS_VOLATILE
120             + ", " + COL_IS_STATEFUL + ", " + COL_REQUESTS_RECOVERY + ", "
121             + COL_JOB_DATAMAP + ") " + " VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)";
122
123     String JavaDoc UPDATE_JOB_DETAIL = "UPDATE "
124             + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " SET "
125             + COL_DESCRIPTION + " = ?, " + COL_JOB_CLASS + " = ?, "
126             + COL_IS_DURABLE + " = ?, " + COL_IS_VOLATILE + " = ?, "
127             + COL_IS_STATEFUL + " = ?, " + COL_REQUESTS_RECOVERY + " = ?, "
128             + COL_JOB_DATAMAP + " = ? " + " WHERE " + COL_JOB_NAME
129             + " = ? AND " + COL_JOB_GROUP + " = ?";
130
131     String JavaDoc SELECT_TRIGGERS_FOR_JOB = "SELECT "
132             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
133             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE " + COL_JOB_NAME
134             + " = ? AND " + COL_JOB_GROUP + " = ?";
135
136     String JavaDoc SELECT_TRIGGERS_FOR_CALENDAR = "SELECT "
137         + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
138         + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE " + COL_CALENDAR_NAME
139         + " = ?";
140
141     String JavaDoc SELECT_STATEFUL_JOBS_OF_TRIGGER_GROUP = "SELECT DISTINCT J."
142             + COL_JOB_NAME
143             + ", J."
144             + COL_JOB_GROUP
145             + " FROM "
146             + TABLE_PREFIX_SUBST
147             + TABLE_TRIGGERS
148             + " T, "
149             + TABLE_PREFIX_SUBST
150             + TABLE_JOB_DETAILS
151             + " J WHERE T."
152             + COL_TRIGGER_GROUP
153             + " = ? AND T."
154             + COL_JOB_NAME
155             + " = J."
156             + COL_JOB_NAME
157             + " AND T."
158             + COL_JOB_GROUP
159             + " = J."
160             + COL_JOB_GROUP
161             + " AND J."
162             + COL_IS_STATEFUL + " = ?";
163
164     String JavaDoc DELETE_JOB_LISTENERS = "DELETE FROM "
165             + TABLE_PREFIX_SUBST + TABLE_JOB_LISTENERS + " WHERE "
166             + COL_JOB_NAME + " = ? AND " + COL_JOB_GROUP + " = ?";
167
168     String JavaDoc DELETE_JOB_DETAIL = "DELETE FROM "
169             + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " WHERE " + COL_JOB_NAME
170             + " = ? AND " + COL_JOB_GROUP + " = ?";
171
172     String JavaDoc SELECT_JOB_STATEFUL = "SELECT "
173             + COL_IS_STATEFUL + " FROM " + TABLE_PREFIX_SUBST
174             + TABLE_JOB_DETAILS + " WHERE " + COL_JOB_NAME + " = ? AND "
175             + COL_JOB_GROUP + " = ?";
176
177     String JavaDoc SELECT_JOB_EXISTENCE = "SELECT " + COL_JOB_NAME
178             + " FROM " + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " WHERE "
179             + COL_JOB_NAME + " = ? AND " + COL_JOB_GROUP + " = ?";
180
181     String JavaDoc UPDATE_JOB_DATA = "UPDATE " + TABLE_PREFIX_SUBST
182             + TABLE_JOB_DETAILS + " SET " + COL_JOB_DATAMAP + " = ? "
183             + " WHERE " + COL_JOB_NAME + " = ? AND " + COL_JOB_GROUP + " = ?";
184
185     String JavaDoc INSERT_JOB_LISTENER = "INSERT INTO "
186             + TABLE_PREFIX_SUBST + TABLE_JOB_LISTENERS + " (" + COL_JOB_NAME
187             + ", " + COL_JOB_GROUP + ", " + COL_JOB_LISTENER
188             + ") VALUES(?, ?, ?)";
189
190     String JavaDoc SELECT_JOB_LISTENERS = "SELECT "
191             + COL_JOB_LISTENER + " FROM " + TABLE_PREFIX_SUBST
192             + TABLE_JOB_LISTENERS + " WHERE " + COL_JOB_NAME + " = ? AND "
193             + COL_JOB_GROUP + " = ?";
194
195     String JavaDoc SELECT_JOB_DETAIL = "SELECT *" + " FROM "
196             + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " WHERE " + COL_JOB_NAME
197             + " = ? AND " + COL_JOB_GROUP + " = ?";
198
199     String JavaDoc SELECT_NUM_JOBS = "SELECT COUNT(" + COL_JOB_NAME
200             + ") " + " FROM " + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS;
201
202     String JavaDoc SELECT_JOB_GROUPS = "SELECT DISTINCT("
203             + COL_JOB_GROUP + ") FROM " + TABLE_PREFIX_SUBST
204             + TABLE_JOB_DETAILS;
205
206     String JavaDoc SELECT_JOBS_IN_GROUP = "SELECT " + COL_JOB_NAME
207             + " FROM " + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " WHERE "
208             + COL_JOB_GROUP + " = ?";
209
210     String JavaDoc SELECT_VOLATILE_JOBS = "SELECT " + COL_JOB_NAME
211             + ", " + COL_JOB_GROUP + " FROM " + TABLE_PREFIX_SUBST
212             + TABLE_JOB_DETAILS + " WHERE " + COL_IS_VOLATILE + " = ?";
213
214     String JavaDoc INSERT_TRIGGER = "INSERT INTO "
215             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " (" + COL_TRIGGER_NAME
216             + ", " + COL_TRIGGER_GROUP + ", " + COL_JOB_NAME + ", "
217             + COL_JOB_GROUP + ", " + COL_IS_VOLATILE + ", " + COL_DESCRIPTION
218             + ", " + COL_NEXT_FIRE_TIME + ", " + COL_PREV_FIRE_TIME + ", "
219             + COL_TRIGGER_STATE + ", " + COL_TRIGGER_TYPE + ", "
220             + COL_START_TIME + ", " + COL_END_TIME + ", " + COL_CALENDAR_NAME
221             + ", " + COL_MISFIRE_INSTRUCTION + ", " + COL_JOB_DATAMAP + ", " + COL_PRIORITY + ") "
222             + " VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
223
224     String JavaDoc INSERT_SIMPLE_TRIGGER = "INSERT INTO "
225             + TABLE_PREFIX_SUBST + TABLE_SIMPLE_TRIGGERS + " ("
226             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
227             + COL_REPEAT_COUNT + ", " + COL_REPEAT_INTERVAL + ", "
228             + COL_TIMES_TRIGGERED + ") " + " VALUES(?, ?, ?, ?, ?)";
229
230     String JavaDoc INSERT_CRON_TRIGGER = "INSERT INTO "
231             + TABLE_PREFIX_SUBST + TABLE_CRON_TRIGGERS + " ("
232             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
233             + COL_CRON_EXPRESSION + ", " + COL_TIME_ZONE_ID + ") "
234             + " VALUES(?, ?, ?, ?)";
235
236     String JavaDoc INSERT_BLOB_TRIGGER = "INSERT INTO "
237             + TABLE_PREFIX_SUBST + TABLE_BLOB_TRIGGERS + " ("
238             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", " + COL_BLOB
239             + ") " + " VALUES(?, ?, ?)";
240
241     String JavaDoc UPDATE_TRIGGER_SKIP_DATA = "UPDATE " + TABLE_PREFIX_SUBST
242             + TABLE_TRIGGERS + " SET " + COL_JOB_NAME + " = ?, "
243             + COL_JOB_GROUP + " = ?, " + COL_IS_VOLATILE + " = ?, "
244             + COL_DESCRIPTION + " = ?, " + COL_NEXT_FIRE_TIME + " = ?, "
245             + COL_PREV_FIRE_TIME + " = ?, " + COL_TRIGGER_STATE + " = ?, "
246             + COL_TRIGGER_TYPE + " = ?, " + COL_START_TIME + " = ?, "
247             + COL_END_TIME + " = ?, " + COL_CALENDAR_NAME + " = ?, "
248             + COL_MISFIRE_INSTRUCTION + " = ?, " + COL_PRIORITY
249             + " = ? WHERE " + COL_TRIGGER_NAME
250             + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
251
252     String JavaDoc UPDATE_TRIGGER = "UPDATE " + TABLE_PREFIX_SUBST
253         + TABLE_TRIGGERS + " SET " + COL_JOB_NAME + " = ?, "
254         + COL_JOB_GROUP + " = ?, " + COL_IS_VOLATILE + " = ?, "
255         + COL_DESCRIPTION + " = ?, " + COL_NEXT_FIRE_TIME + " = ?, "
256         + COL_PREV_FIRE_TIME + " = ?, " + COL_TRIGGER_STATE + " = ?, "
257         + COL_TRIGGER_TYPE + " = ?, " + COL_START_TIME + " = ?, "
258         + COL_END_TIME + " = ?, " + COL_CALENDAR_NAME + " = ?, "
259         + COL_MISFIRE_INSTRUCTION + " = ?, " + COL_PRIORITY + " = ?, "
260         + COL_JOB_DATAMAP + " = ? WHERE "
261         + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
262     
263     String JavaDoc UPDATE_SIMPLE_TRIGGER = "UPDATE "
264             + TABLE_PREFIX_SUBST + TABLE_SIMPLE_TRIGGERS + " SET "
265             + COL_REPEAT_COUNT + " = ?, " + COL_REPEAT_INTERVAL + " = ?, "
266             + COL_TIMES_TRIGGERED + " = ? WHERE " + COL_TRIGGER_NAME
267             + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
268
269     String JavaDoc UPDATE_CRON_TRIGGER = "UPDATE "
270             + TABLE_PREFIX_SUBST + TABLE_CRON_TRIGGERS + " SET "
271             + COL_CRON_EXPRESSION + " = ? WHERE " + COL_TRIGGER_NAME
272             + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
273
274     String JavaDoc UPDATE_BLOB_TRIGGER = "UPDATE "
275             + TABLE_PREFIX_SUBST + TABLE_BLOB_TRIGGERS + " SET " + COL_BLOB
276             + " = ? WHERE " + COL_TRIGGER_NAME + " = ? AND "
277             + COL_TRIGGER_GROUP + " = ?";
278
279     String JavaDoc SELECT_TRIGGER_EXISTENCE = "SELECT "
280             + COL_TRIGGER_NAME + " FROM " + TABLE_PREFIX_SUBST + TABLE_TRIGGERS
281             + " WHERE " + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP
282             + " = ?";
283
284     String JavaDoc UPDATE_TRIGGER_STATE = "UPDATE "
285             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " SET " + COL_TRIGGER_STATE
286             + " = ?" + " WHERE " + COL_TRIGGER_NAME + " = ? AND "
287             + COL_TRIGGER_GROUP + " = ?";
288
289     String JavaDoc UPDATE_TRIGGER_STATE_FROM_STATE = "UPDATE "
290             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " SET " + COL_TRIGGER_STATE
291             + " = ?" + " WHERE " + COL_TRIGGER_NAME + " = ? AND "
292             + COL_TRIGGER_GROUP + " = ? AND " + COL_TRIGGER_STATE + " = ?";
293
294     String JavaDoc UPDATE_TRIGGER_GROUP_STATE = "UPDATE "
295             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " SET " + COL_TRIGGER_STATE
296             + " = ?";
297
298     String JavaDoc UPDATE_TRIGGER_GROUP_STATE_FROM_STATE = "UPDATE "
299             + TABLE_PREFIX_SUBST
300             + TABLE_TRIGGERS
301             + " SET "
302             + COL_TRIGGER_STATE
303             + " = ?"
304             + " WHERE "
305             + COL_TRIGGER_GROUP
306             + " = ? AND "
307             + COL_TRIGGER_STATE + " = ?";
308
309     String JavaDoc UPDATE_TRIGGER_STATE_FROM_STATES = "UPDATE "
310             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " SET " + COL_TRIGGER_STATE
311             + " = ?" + " WHERE " + COL_TRIGGER_NAME + " = ? AND "
312             + COL_TRIGGER_GROUP + " = ? AND (" + COL_TRIGGER_STATE + " = ? OR "
313             + COL_TRIGGER_STATE + " = ? OR " + COL_TRIGGER_STATE + " = ?)";
314
315     String JavaDoc UPDATE_TRIGGER_GROUP_STATE_FROM_STATES = "UPDATE "
316             + TABLE_PREFIX_SUBST
317             + TABLE_TRIGGERS
318             + " SET "
319             + COL_TRIGGER_STATE
320             + " = ?"
321             + " WHERE "
322             + COL_TRIGGER_GROUP
323             + " = ? AND ("
324             + COL_TRIGGER_STATE
325             + " = ? OR "
326             + COL_TRIGGER_STATE
327             + " = ? OR "
328             + COL_TRIGGER_STATE + " = ?)";
329
330     String JavaDoc UPDATE_JOB_TRIGGER_STATES = "UPDATE "
331             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " SET " + COL_TRIGGER_STATE
332             + " = ? WHERE " + COL_JOB_NAME + " = ? AND " + COL_JOB_GROUP
333             + " = ?";
334
335     String JavaDoc UPDATE_JOB_TRIGGER_STATES_FROM_OTHER_STATE = "UPDATE "
336             + TABLE_PREFIX_SUBST
337             + TABLE_TRIGGERS
338             + " SET "
339             + COL_TRIGGER_STATE
340             + " = ? WHERE "
341             + COL_JOB_NAME
342             + " = ? AND "
343             + COL_JOB_GROUP
344             + " = ? AND " + COL_TRIGGER_STATE + " = ?";
345
346     String JavaDoc DELETE_TRIGGER_LISTENERS = "DELETE FROM "
347             + TABLE_PREFIX_SUBST + TABLE_TRIGGER_LISTENERS + " WHERE "
348             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
349
350     String JavaDoc INSERT_TRIGGER_LISTENER = "INSERT INTO "
351             + TABLE_PREFIX_SUBST + TABLE_TRIGGER_LISTENERS + " ("
352             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
353             + COL_TRIGGER_LISTENER + ") VALUES(?, ?, ?)";
354
355     String JavaDoc SELECT_TRIGGER_LISTENERS = "SELECT "
356             + COL_TRIGGER_LISTENER + " FROM " + TABLE_PREFIX_SUBST
357             + TABLE_TRIGGER_LISTENERS + " WHERE " + COL_TRIGGER_NAME
358             + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
359
360     String JavaDoc DELETE_SIMPLE_TRIGGER = "DELETE FROM "
361             + TABLE_PREFIX_SUBST + TABLE_SIMPLE_TRIGGERS + " WHERE "
362             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
363
364     String JavaDoc DELETE_CRON_TRIGGER = "DELETE FROM "
365             + TABLE_PREFIX_SUBST + TABLE_CRON_TRIGGERS + " WHERE "
366             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
367
368     String JavaDoc DELETE_BLOB_TRIGGER = "DELETE FROM "
369             + TABLE_PREFIX_SUBST + TABLE_BLOB_TRIGGERS + " WHERE "
370             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
371
372     String JavaDoc DELETE_TRIGGER = "DELETE FROM "
373             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
374             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
375
376     String JavaDoc SELECT_NUM_TRIGGERS_FOR_JOB = "SELECT COUNT("
377             + COL_TRIGGER_NAME + ") FROM " + TABLE_PREFIX_SUBST
378             + TABLE_TRIGGERS + " WHERE " + COL_JOB_NAME + " = ? AND "
379             + COL_JOB_GROUP + " = ?";
380
381     String JavaDoc SELECT_JOB_FOR_TRIGGER = "SELECT J."
382             + COL_JOB_NAME + ", J." + COL_JOB_GROUP + ", J." + COL_IS_DURABLE
383             + ", J." + COL_JOB_CLASS + ", J." + COL_REQUESTS_RECOVERY + " FROM " + TABLE_PREFIX_SUBST
384             + TABLE_TRIGGERS + " T, " + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS
385             + " J WHERE T." + COL_TRIGGER_NAME + " = ? AND T."
386             + COL_TRIGGER_GROUP + " = ? AND T." + COL_JOB_NAME + " = J."
387             + COL_JOB_NAME + " AND T." + COL_JOB_GROUP + " = J."
388             + COL_JOB_GROUP;
389
390     String JavaDoc SELECT_TRIGGER = "SELECT *" + " FROM "
391             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
392             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
393
394     String JavaDoc SELECT_TRIGGER_DATA = "SELECT " +
395             COL_JOB_DATAMAP + " FROM "
396             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
397             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
398         
399     String JavaDoc SELECT_TRIGGER_STATE = "SELECT "
400             + COL_TRIGGER_STATE + " FROM " + TABLE_PREFIX_SUBST
401             + TABLE_TRIGGERS + " WHERE " + COL_TRIGGER_NAME + " = ? AND "
402             + COL_TRIGGER_GROUP + " = ?";
403
404     String JavaDoc SELECT_TRIGGER_STATUS = "SELECT "
405             + COL_TRIGGER_STATE + ", " + COL_NEXT_FIRE_TIME + ", "
406             + COL_JOB_NAME + ", " + COL_JOB_GROUP + " FROM "
407             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
408             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
409
410     String JavaDoc SELECT_SIMPLE_TRIGGER = "SELECT *" + " FROM "
411             + TABLE_PREFIX_SUBST + TABLE_SIMPLE_TRIGGERS + " WHERE "
412             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
413
414     String JavaDoc SELECT_CRON_TRIGGER = "SELECT *" + " FROM "
415             + TABLE_PREFIX_SUBST + TABLE_CRON_TRIGGERS + " WHERE "
416             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
417
418     String JavaDoc SELECT_BLOB_TRIGGER = "SELECT *" + " FROM "
419             + TABLE_PREFIX_SUBST + TABLE_BLOB_TRIGGERS + " WHERE "
420             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
421
422     String JavaDoc SELECT_NUM_TRIGGERS = "SELECT COUNT("
423             + COL_TRIGGER_NAME + ") " + " FROM " + TABLE_PREFIX_SUBST
424             + TABLE_TRIGGERS;
425
426     String JavaDoc SELECT_NUM_TRIGGERS_IN_GROUP = "SELECT COUNT("
427             + COL_TRIGGER_NAME + ") " + " FROM " + TABLE_PREFIX_SUBST
428             + TABLE_TRIGGERS + " WHERE " + COL_TRIGGER_GROUP + " = ?";
429
430     String JavaDoc SELECT_TRIGGER_GROUPS = "SELECT DISTINCT("
431             + COL_TRIGGER_GROUP + ") FROM " + TABLE_PREFIX_SUBST
432             + TABLE_TRIGGERS;
433
434     String JavaDoc SELECT_TRIGGERS_IN_GROUP = "SELECT "
435             + COL_TRIGGER_NAME + " FROM " + TABLE_PREFIX_SUBST + TABLE_TRIGGERS
436             + " WHERE " + COL_TRIGGER_GROUP + " = ?";
437
438     String JavaDoc INSERT_CALENDAR = "INSERT INTO "
439             + TABLE_PREFIX_SUBST + TABLE_CALENDARS + " (" + COL_CALENDAR_NAME
440             + ", " + COL_CALENDAR + ") " + " VALUES(?, ?)";
441
442     String JavaDoc UPDATE_CALENDAR = "UPDATE " + TABLE_PREFIX_SUBST
443             + TABLE_CALENDARS + " SET " + COL_CALENDAR + " = ? " + " WHERE "
444             + COL_CALENDAR_NAME + " = ?";
445
446     String JavaDoc SELECT_CALENDAR_EXISTENCE = "SELECT "
447             + COL_CALENDAR_NAME + " FROM " + TABLE_PREFIX_SUBST
448             + TABLE_CALENDARS + " WHERE " + COL_CALENDAR_NAME + " = ?";
449
450     String JavaDoc SELECT_CALENDAR = "SELECT *" + " FROM "
451             + TABLE_PREFIX_SUBST + TABLE_CALENDARS + " WHERE "
452             + COL_CALENDAR_NAME + " = ?";
453
454     String JavaDoc SELECT_REFERENCED_CALENDAR = "SELECT "
455             + COL_CALENDAR_NAME + " FROM " + TABLE_PREFIX_SUBST
456             + TABLE_TRIGGERS + " WHERE " + COL_CALENDAR_NAME + " = ?";
457
458     String JavaDoc DELETE_CALENDAR = "DELETE FROM "
459             + TABLE_PREFIX_SUBST + TABLE_CALENDARS + " WHERE "
460             + COL_CALENDAR_NAME + " = ?";
461
462     String JavaDoc SELECT_NUM_CALENDARS = "SELECT COUNT("
463             + COL_CALENDAR_NAME + ") " + " FROM " + TABLE_PREFIX_SUBST
464             + TABLE_CALENDARS;
465
466     String JavaDoc SELECT_CALENDARS = "SELECT " + COL_CALENDAR_NAME
467             + " FROM " + TABLE_PREFIX_SUBST + TABLE_CALENDARS;
468
469     String JavaDoc SELECT_NEXT_FIRE_TIME = "SELECT MIN("
470             + COL_NEXT_FIRE_TIME + ") AS " + ALIAS_COL_NEXT_FIRE_TIME
471             + " FROM " + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
472             + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " >= 0";
473
474     String JavaDoc SELECT_TRIGGER_FOR_FIRE_TIME = "SELECT "
475             + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM "
476             + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
477             + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " = ?";
478
479     String JavaDoc SELECT_NEXT_TRIGGER_TO_ACQUIRE = "SELECT "
480         + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", " + COL_NEXT_FIRE_TIME + " FROM "
481         + TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
482         + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " < ? "
483         + "AND (" + COL_NEXT_FIRE_TIME + " >= ?) "
484         + "ORDER BY "+ COL_NEXT_FIRE_TIME + " ASC, " + COL_PRIORITY + " DESC";
485     
486     
487     String JavaDoc INSERT_FIRED_TRIGGER = "INSERT INTO "
488             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " (" + COL_ENTRY_ID
489             + ", " + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
490             + COL_IS_VOLATILE + ", " + COL_INSTANCE_NAME + ", "
491             + COL_FIRED_TIME + ", " + COL_ENTRY_STATE + ", " + COL_JOB_NAME
492             + ", " + COL_JOB_GROUP + ", " + COL_IS_STATEFUL + ", "
493             + COL_REQUESTS_RECOVERY + ", " + COL_PRIORITY
494             + ") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
495
496     String JavaDoc UPDATE_INSTANCES_FIRED_TRIGGER_STATE = "UPDATE "
497             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " SET "
498             + COL_ENTRY_STATE + " = ? AND " + COL_FIRED_TIME + " = ? AND " + COL_PRIORITY+ " = ? WHERE "
499             + COL_INSTANCE_NAME + " = ?";
500
501     String JavaDoc SELECT_INSTANCES_FIRED_TRIGGERS = "SELECT * FROM "
502             + TABLE_PREFIX_SUBST
503             + TABLE_FIRED_TRIGGERS
504             + " WHERE "
505             + COL_INSTANCE_NAME + " = ?";
506
507     String JavaDoc SELECT_INSTANCES_RECOVERABLE_FIRED_TRIGGERS = "SELECT * FROM "
508             + TABLE_PREFIX_SUBST
509             + TABLE_FIRED_TRIGGERS
510             + " WHERE "
511             + COL_INSTANCE_NAME + " = ? AND " + COL_REQUESTS_RECOVERY + " = ?";
512
513     String JavaDoc SELECT_JOB_EXECUTION_COUNT = "SELECT COUNT("
514             + COL_TRIGGER_NAME + ") FROM " + TABLE_PREFIX_SUBST
515             + TABLE_FIRED_TRIGGERS + " WHERE " + COL_JOB_NAME + " = ? AND "
516             + COL_JOB_GROUP + " = ?";
517
518     String JavaDoc SELECT_FIRED_TRIGGERS = "SELECT * FROM "
519             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS;
520
521     String JavaDoc SELECT_FIRED_TRIGGER = "SELECT * FROM "
522             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " WHERE "
523             + COL_TRIGGER_NAME + " = ? AND " + COL_TRIGGER_GROUP + " = ?";
524
525     String JavaDoc SELECT_FIRED_TRIGGER_GROUP = "SELECT * FROM "
526             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " WHERE "
527             + COL_TRIGGER_GROUP + " = ?";
528
529     String JavaDoc SELECT_FIRED_TRIGGERS_OF_JOB = "SELECT * FROM "
530             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " WHERE "
531             + COL_JOB_NAME + " = ? AND " + COL_JOB_GROUP + " = ?";
532
533     String JavaDoc SELECT_FIRED_TRIGGERS_OF_JOB_GROUP = "SELECT * FROM "
534             + TABLE_PREFIX_SUBST
535             + TABLE_FIRED_TRIGGERS
536             + " WHERE "
537             + COL_JOB_GROUP + " = ?";
538
539     String JavaDoc DELETE_FIRED_TRIGGER = "DELETE FROM "
540             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " WHERE "
541             + COL_ENTRY_ID + " = ?";
542
543     String JavaDoc DELETE_INSTANCES_FIRED_TRIGGERS = "DELETE FROM "
544             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " WHERE "
545             + COL_INSTANCE_NAME + " = ?";
546
547     String JavaDoc DELETE_VOLATILE_FIRED_TRIGGERS = "DELETE FROM "
548             + TABLE_PREFIX_SUBST + TABLE_FIRED_TRIGGERS + " WHERE "
549             + COL_IS_VOLATILE + " = ?";
550
551     String JavaDoc DELETE_NO_RECOVERY_FIRED_TRIGGERS = "DELETE FROM "
552             + TABLE_PREFIX_SUBST
553             + TABLE_FIRED_TRIGGERS
554             + " WHERE "
555             + COL_INSTANCE_NAME + " = ?" + COL_REQUESTS_RECOVERY + " = ?";
556
557     String JavaDoc SELECT_FIRED_TRIGGER_INSTANCE_NAMES =
558             "SELECT DISTINCT " + COL_INSTANCE_NAME + " FROM "
559             + TABLE_PREFIX_SUBST
560             + TABLE_FIRED_TRIGGERS;
561     
562     String JavaDoc INSERT_SCHEDULER_STATE = "INSERT INTO "
563             + TABLE_PREFIX_SUBST + TABLE_SCHEDULER_STATE + " ("
564             + COL_INSTANCE_NAME + ", " + COL_LAST_CHECKIN_TIME + ", "
565             + COL_CHECKIN_INTERVAL + ") VALUES(?, ?, ?)";
566
567     String JavaDoc SELECT_SCHEDULER_STATE = "SELECT * FROM "
568             + TABLE_PREFIX_SUBST + TABLE_SCHEDULER_STATE + " WHERE "
569             + COL_INSTANCE_NAME + " = ?";
570
571     String JavaDoc SELECT_SCHEDULER_STATES = "SELECT * FROM "
572             + TABLE_PREFIX_SUBST + TABLE_SCHEDULER_STATE;
573
574     String JavaDoc DELETE_SCHEDULER_STATE = "DELETE FROM "
575         + TABLE_PREFIX_SUBST + TABLE_SCHEDULER_STATE + " WHERE "
576         + COL_INSTANCE_NAME + " = ?";
577
578     String JavaDoc UPDATE_SCHEDULER_STATE = "UPDATE "
579         + TABLE_PREFIX_SUBST + TABLE_SCHEDULER_STATE + " SET "
580         + COL_LAST_CHECKIN_TIME + " = ? WHERE "
581         + COL_INSTANCE_NAME + " = ?";
582
583     String JavaDoc INSERT_PAUSED_TRIGGER_GROUP = "INSERT INTO "
584             + TABLE_PREFIX_SUBST + TABLE_PAUSED_TRIGGERS + " ("
585             + COL_TRIGGER_GROUP + ") VALUES(?)";
586
587     String JavaDoc SELECT_PAUSED_TRIGGER_GROUP = "SELECT "
588             + COL_TRIGGER_GROUP + " FROM " + TABLE_PREFIX_SUBST
589             + TABLE_PAUSED_TRIGGERS + " WHERE " + COL_TRIGGER_GROUP + " = ?";
590
591     String JavaDoc SELECT_PAUSED_TRIGGER_GROUPS = "SELECT "
592         + COL_TRIGGER_GROUP + " FROM " + TABLE_PREFIX_SUBST
593         + TABLE_PAUSED_TRIGGERS;
594
595     String JavaDoc DELETE_PAUSED_TRIGGER_GROUP = "DELETE FROM "
596             + TABLE_PREFIX_SUBST + TABLE_PAUSED_TRIGGERS + " WHERE "
597             + COL_TRIGGER_GROUP + " = ?";
598
599     String JavaDoc DELETE_PAUSED_TRIGGER_GROUPS = "DELETE FROM "
600             + TABLE_PREFIX_SUBST + TABLE_PAUSED_TRIGGERS;
601
602     // CREATE TABLE qrtz_scheduler_state(INSTANCE_NAME VARCHAR2(80) NOT NULL,
603
// LAST_CHECKIN_TIME NUMBER(13) NOT NULL, CHECKIN_INTERVAL NUMBER(13) NOT
604
// NULL, PRIMARY KEY (INSTANCE_NAME));
605

606 }
607
608 // EOF
609
Popular Tags