You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

tables_derby.sql 5.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. --
  2. -- Apache Derby scripts by Steve Stewart, updated by Ronald Pomeroy
  3. -- Based on Srinivas Venkatarangaiah's file for Cloudscape
  4. --
  5. -- Known to work with Apache Derby 10.0.2.1, or 10.6.2.1
  6. --
  7. -- Updated by Zemian Deng <saltnlight5@gmail.com> on 08/21/2011
  8. -- * Fixed nullable fields on qrtz_simprop_triggers table.
  9. -- * Added Derby QuickStart comments and drop tables statements.
  10. --
  11. -- DerbyDB + Quartz Quick Guide:
  12. -- * Derby comes with Oracle JDK! For Java6, it default install into C:/Program Files/Sun/JavaDB on Windows.
  13. -- 1. Create a derby.properties file under JavaDB directory, and have the following:
  14. -- derby.connection.requireAuthentication = true
  15. -- derby.authentication.provider = BUILTIN
  16. -- derby.user.quartz2=quartz2123
  17. -- 2. Start the DB server by running bin/startNetworkServer script.
  18. -- 3. On a new terminal, run bin/ij tool to bring up an SQL prompt, then run:
  19. -- connect 'jdbc:derby://localhost:1527/quartz2;user=quartz2;password=quartz2123;create=true';
  20. -- run 'quartz/docs/dbTables/tables_derby.sql';
  21. -- Now in quartz.properties, you may use these properties:
  22. -- org.quartz.dataSource.quartzDataSource.driver = org.apache.derby.jdbc.ClientDriver
  23. -- org.quartz.dataSource.quartzDataSource.URL = jdbc:derby://localhost:1527/quartz2
  24. -- org.quartz.dataSource.quartzDataSource.user = quartz2
  25. -- org.quartz.dataSource.quartzDataSource.password = quartz2123
  26. --
  27. -- Auto drop and reset tables
  28. -- Derby doesn't support if exists condition on table drop, so user must manually do this step if needed to.
  29. -- drop table qrtz_fired_triggers;
  30. -- drop table qrtz_paused_trigger_grps;
  31. -- drop table qrtz_scheduler_state;
  32. -- drop table qrtz_locks;
  33. -- drop table qrtz_simple_triggers;
  34. -- drop table qrtz_simprop_triggers;
  35. -- drop table qrtz_cron_triggers;
  36. -- drop table qrtz_blob_triggers;
  37. -- drop table qrtz_triggers;
  38. -- drop table qrtz_job_details;
  39. -- drop table qrtz_calendars;
  40. create table qrtz_job_details (
  41. sched_name varchar(120) not null,
  42. job_name varchar(200) not null,
  43. job_group varchar(200) not null,
  44. description varchar(250) ,
  45. job_class_name varchar(250) not null,
  46. is_durable varchar(5) not null,
  47. is_nonconcurrent varchar(5) not null,
  48. is_update_data varchar(5) not null,
  49. requests_recovery varchar(5) not null,
  50. job_data blob,
  51. primary key (sched_name,job_name,job_group)
  52. );
  53. create table qrtz_triggers(
  54. sched_name varchar(120) not null,
  55. trigger_name varchar(200) not null,
  56. trigger_group varchar(200) not null,
  57. job_name varchar(200) not null,
  58. job_group varchar(200) not null,
  59. description varchar(250),
  60. next_fire_time bigint,
  61. prev_fire_time bigint,
  62. priority integer,
  63. trigger_state varchar(16) not null,
  64. trigger_type varchar(8) not null,
  65. start_time bigint not null,
  66. end_time bigint,
  67. calendar_name varchar(200),
  68. misfire_instr smallint,
  69. job_data blob,
  70. primary key (sched_name,trigger_name,trigger_group),
  71. foreign key (sched_name,job_name,job_group) references qrtz_job_details(sched_name,job_name,job_group)
  72. );
  73. create table qrtz_simple_triggers(
  74. sched_name varchar(120) not null,
  75. trigger_name varchar(200) not null,
  76. trigger_group varchar(200) not null,
  77. repeat_count bigint not null,
  78. repeat_interval bigint not null,
  79. times_triggered bigint not null,
  80. primary key (sched_name,trigger_name,trigger_group),
  81. foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
  82. );
  83. create table qrtz_cron_triggers(
  84. sched_name varchar(120) not null,
  85. trigger_name varchar(200) not null,
  86. trigger_group varchar(200) not null,
  87. cron_expression varchar(120) not null,
  88. time_zone_id varchar(80),
  89. primary key (sched_name,trigger_name,trigger_group),
  90. foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
  91. );
  92. create table qrtz_simprop_triggers
  93. (
  94. sched_name varchar(120) not null,
  95. trigger_name varchar(200) not null,
  96. trigger_group varchar(200) not null,
  97. str_prop_1 varchar(512),
  98. str_prop_2 varchar(512),
  99. str_prop_3 varchar(512),
  100. int_prop_1 int,
  101. int_prop_2 int,
  102. long_prop_1 bigint,
  103. long_prop_2 bigint,
  104. dec_prop_1 numeric(13,4),
  105. dec_prop_2 numeric(13,4),
  106. bool_prop_1 varchar(5),
  107. bool_prop_2 varchar(5),
  108. primary key (sched_name,trigger_name,trigger_group),
  109. foreign key (sched_name,trigger_name,trigger_group)
  110. references qrtz_triggers(sched_name,trigger_name,trigger_group)
  111. );
  112. create table qrtz_blob_triggers(
  113. sched_name varchar(120) not null,
  114. trigger_name varchar(200) not null,
  115. trigger_group varchar(200) not null,
  116. blob_data blob,
  117. primary key (sched_name,trigger_name,trigger_group),
  118. foreign key (sched_name,trigger_name,trigger_group) references qrtz_triggers(sched_name,trigger_name,trigger_group)
  119. );
  120. create table qrtz_calendars(
  121. sched_name varchar(120) not null,
  122. calendar_name varchar(200) not null,
  123. calendar blob not null,
  124. primary key (sched_name,calendar_name)
  125. );
  126. create table qrtz_paused_trigger_grps
  127. (
  128. sched_name varchar(120) not null,
  129. trigger_group varchar(200) not null,
  130. primary key (sched_name,trigger_group)
  131. );
  132. create table qrtz_fired_triggers(
  133. sched_name varchar(120) not null,
  134. entry_id varchar(95) not null,
  135. trigger_name varchar(200) not null,
  136. trigger_group varchar(200) not null,
  137. instance_name varchar(200) not null,
  138. fired_time bigint not null,
  139. sched_time bigint not null,
  140. priority integer not null,
  141. state varchar(16) not null,
  142. job_name varchar(200),
  143. job_group varchar(200),
  144. is_nonconcurrent varchar(5),
  145. requests_recovery varchar(5),
  146. primary key (sched_name,entry_id)
  147. );
  148. create table qrtz_scheduler_state
  149. (
  150. sched_name varchar(120) not null,
  151. instance_name varchar(200) not null,
  152. last_checkin_time bigint not null,
  153. checkin_interval bigint not null,
  154. primary key (sched_name,instance_name)
  155. );
  156. create table qrtz_locks
  157. (
  158. sched_name varchar(120) not null,
  159. lock_name varchar(40) not null,
  160. primary key (sched_name,lock_name)
  161. );