File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\command\CommandInterface.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.command;
8
9 import java.util.ArrayList;
10 import org.h2.expression.ParameterInterface;
11 import org.h2.result.ResultInterface;
12
13 /**
14 * Represents a SQL statement.
15 */
16 public interface CommandInterface {
17
18 /**
19 * The type for unknown statement.
20 */
21 int UNKNOWN = 0;
22
23 // ddl operations
24
25 /**
26 * The type of a ALTER INDEX RENAME statement.
27 */
28 int ALTER_INDEX_RENAME = 1;
29
30 /**
31 * The type of a ALTER SCHEMA RENAME statement.
32 */
33 int ALTER_SCHEMA_RENAME = 2;
34
35 /**
36 * The type of a ALTER TABLE ADD CHECK statement.
37 */
38 int ALTER_TABLE_ADD_CONSTRAINT_CHECK = 3;
39
40 /**
41 * The type of a ALTER TABLE ADD UNIQUE statement.
42 */
43 int ALTER_TABLE_ADD_CONSTRAINT_UNIQUE = 4;
44
45 /**
46 * The type of a ALTER TABLE ADD FOREIGN KEY statement.
47 */
48 int ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL = 5;
49
50 /**
51 * The type of a ALTER TABLE ADD PRIMARY KEY statement.
52 */
53 int ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY = 6;
54
55 /**
56 * The type of a ALTER TABLE ADD statement.
57 */
58 int ALTER_TABLE_ADD_COLUMN = 7;
59
60 /**
61 * The type of a ALTER TABLE ALTER COLUMN SET NOT NULL statement.
62 */
63 int ALTER_TABLE_ALTER_COLUMN_NOT_NULL = 8;
64
65 /**
66 * The type of a ALTER TABLE ALTER COLUMN SET NULL statement.
67 */
68 int ALTER_TABLE_ALTER_COLUMN_NULL = 9;
69
70 /**
71 * The type of a ALTER TABLE ALTER COLUMN SET DEFAULT statement.
72 */
73 int ALTER_TABLE_ALTER_COLUMN_DEFAULT = 10;
74
75 /**
76 * The type of an ALTER TABLE ALTER COLUMN statement that changes the column
77 * data type.
78 */
79 int ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE = 11;
80
81 /**
82 * The type of a ALTER TABLE DROP COLUMN statement.
83 */
84 int ALTER_TABLE_DROP_COLUMN = 12;
85
86 /**
87 * The type of a ALTER TABLE ALTER COLUMN SELECTIVITY statement.
88 */
89 int ALTER_TABLE_ALTER_COLUMN_SELECTIVITY = 13;
90
91 /**
92 * The type of a ALTER TABLE DROP CONSTRAINT statement.
93 */
94 int ALTER_TABLE_DROP_CONSTRAINT = 14;
95
96 /**
97 * The type of a ALTER TABLE RENAME statement.
98 */
99 int ALTER_TABLE_RENAME = 15;
100
101 /**
102 * The type of a ALTER TABLE ALTER COLUMN RENAME statement.
103 */
104 int ALTER_TABLE_ALTER_COLUMN_RENAME = 16;
105
106 /**
107 * The type of a ALTER USER ADMIN statement.
108 */
109 int ALTER_USER_ADMIN = 17;
110
111 /**
112 * The type of a ALTER USER RENAME statement.
113 */
114 int ALTER_USER_RENAME = 18;
115
116 /**
117 * The type of a ALTER USER SET PASSWORD statement.
118 */
119 int ALTER_USER_SET_PASSWORD = 19;
120
121 /**
122 * The type of a ALTER VIEW statement.
123 */
124 int ALTER_VIEW = 20;
125
126 /**
127 * The type of a ANALYZE statement.
128 */
129 int ANALYZE = 21;
130
131 /**
132 * The type of a CREATE AGGREGATE statement.
133 */
134 int CREATE_AGGREGATE = 22;
135
136 /**
137 * The type of a CREATE CONSTANT statement.
138 */
139 int CREATE_CONSTANT = 23;
140
141 /**
142 * The type of a CREATE ALIAS statement.
143 */
144 int CREATE_ALIAS = 24;
145
146 /**
147 * The type of a CREATE INDEX statement.
148 */
149 int CREATE_INDEX = 25;
150
151 /**
152 * The type of a CREATE LINKED TABLE statement.
153 */
154 int CREATE_LINKED_TABLE = 26;
155
156 /**
157 * The type of a CREATE ROLE statement.
158 */
159 int CREATE_ROLE = 27;
160
161 /**
162 * The type of a CREATE SCHEMA statement.
163 */
164 int CREATE_SCHEMA = 28;
165
166 /**
167 * The type of a CREATE SEQUENCE statement.
168 */
169 int CREATE_SEQUENCE = 29;
170
171 /**
172 * The type of a CREATE TABLE statement.
173 */
174 int CREATE_TABLE = 30;
175
176 /**
177 * The type of a CREATE TRIGGER statement.
178 */
179 int CREATE_TRIGGER = 31;
180
181 /**
182 * The type of a CREATE USER statement.
183 */
184 int CREATE_USER = 32;
185
186 /**
187 * The type of a CREATE DOMAIN statement.
188 */
189 int CREATE_DOMAIN = 33;
190
191 /**
192 * The type of a CREATE VIEW statement.
193 */
194 int CREATE_VIEW = 34;
195
196 /**
197 * The type of a DEALLOCATE statement.
198 */
199 int DEALLOCATE = 35;
200
201 /**
202 * The type of a DROP AGGREGATE statement.
203 */
204 int DROP_AGGREGATE = 36;
205
206 /**
207 * The type of a DROP CONSTANT statement.
208 */
209 int DROP_CONSTANT = 37;
210
211 /**
212 * The type of a DROP ALL OBJECTS statement.
213 */
214 int DROP_ALL_OBJECTS = 38;
215
216 /**
217 * The type of a DROP ALIAS statement.
218 */
219 int DROP_ALIAS = 39;
220
221 /**
222 * The type of a DROP INDEX statement.
223 */
224 int DROP_INDEX = 40;
225
226 /**
227 * The type of a DROP ROLE statement.
228 */
229 int DROP_ROLE = 41;
230
231 /**
232 * The type of a DROP SCHEMA statement.
233 */
234 int DROP_SCHEMA = 42;
235
236 /**
237 * The type of a DROP SEQUENCE statement.
238 */
239 int DROP_SEQUENCE = 43;
240
241 /**
242 * The type of a DROP TABLE statement.
243 */
244 int DROP_TABLE = 44;
245
246 /**
247 * The type of a DROP TRIGGER statement.
248 */
249 int DROP_TRIGGER = 45;
250
251 /**
252 * The type of a DROP USER statement.
253 */
254 int DROP_USER = 46;
255
256 /**
257 * The type of a DROP DOMAIN statement.
258 */
259 int DROP_DOMAIN = 47;
260
261 /**
262 * The type of a DROP VIEW statement.
263 */
264 int DROP_VIEW = 48;
265
266 /**
267 * The type of a GRANT statement.
268 */
269 int GRANT = 49;
270
271 /**
272 * The type of a REVOKE statement.
273 */
274 int REVOKE = 50;
275
276 /**
277 * The type of a PREPARE statement.
278 */
279 int PREPARE = 51;
280
281 /**
282 * The type of a COMMENT statement.
283 */
284 int COMMENT = 52;
285
286 /**
287 * The type of a TRUNCATE TABLE statement.
288 */
289 int TRUNCATE_TABLE = 53;
290
291 // dml operations
292
293 /**
294 * The type of a ALTER SEQUENCE statement.
295 */
296 int ALTER_SEQUENCE = 54;
297
298 /**
299 * The type of a ALTER TABLE SET REFERENTIAL_INTEGRITY statement.
300 */
301 int ALTER_TABLE_SET_REFERENTIAL_INTEGRITY = 55;
302
303 /**
304 * The type of a BACKUP statement.
305 */
306 int BACKUP = 56;
307
308 /**
309 * The type of a CALL statement.
310 */
311 int CALL = 57;
312
313 /**
314 * The type of a DELETE statement.
315 */
316 int DELETE = 58;
317
318 /**
319 * The type of a EXECUTE statement.
320 */
321 int EXECUTE = 59;
322
323 /**
324 * The type of a EXPLAIN statement.
325 */
326 int EXPLAIN = 60;
327
328 /**
329 * The type of a INSERT statement.
330 */
331 int INSERT = 61;
332
333 /**
334 * The type of a MERGE statement.
335 */
336 int MERGE = 62;
337
338 /**
339 * The type of a no operation statement.
340 */
341 int NO_OPERATION = 63;
342
343 /**
344 * The type of a RUNSCRIPT statement.
345 */
346 int RUNSCRIPT = 64;
347
348 /**
349 * The type of a SCRIPT statement.
350 */
351 int SCRIPT = 65;
352
353 /**
354 * The type of a SELECT statement.
355 */
356 int SELECT = 66;
357
358 /**
359 * The type of a SET statement.
360 */
361 int SET = 67;
362
363 /**
364 * The type of a UPDATE statement.
365 */
366 int UPDATE = 68;
367
368 // transaction commands
369
370 /**
371 * The type of a SET AUTOCOMMIT statement.
372 */
373 int SET_AUTOCOMMIT_TRUE = 69;
374
375 /**
376 * The type of a SET AUTOCOMMIT statement.
377 */
378 int SET_AUTOCOMMIT_FALSE = 70;
379
380 /**
381 * The type of a COMMIT statement.
382 */
383 int COMMIT = 71;
384
385 /**
386 * The type of a ROLLBACK statement.
387 */
388 int ROLLBACK = 72;
389
390 /**
391 * The type of a CHECKPOINT statement.
392 */
393 int CHECKPOINT = 73;
394
395 /**
396 * The type of a SAVEPOINT statement.
397 */
398 int SAVEPOINT = 74;
399
400 /**
401 * The type of a ROLLBACK TO SAVEPOINT statement.
402 */
403 int ROLLBACK_TO_SAVEPOINT = 75;
404
405 /**
406 * The type of a CHECKPOINT SYNC statement.
407 */
408 int CHECKPOINT_SYNC = 76;
409
410 /**
411 * The type of a PREPARE COMMIT statement.
412 */
413 int PREPARE_COMMIT = 77;
414
415 /**
416 * The type of a COMMIT TRANSACTION statement.
417 */
418 int COMMIT_TRANSACTION = 78;
419
420 /**
421 * The type of a ROLLBACK TRANSACTION statement.
422 */
423 int ROLLBACK_TRANSACTION = 79;
424
425 /**
426 * The type of a SHUTDOWN statement.
427 */
428 int SHUTDOWN = 80;
429
430 /**
431 * The type of a SHUTDOWN IMMEDIATELY statement.
432 */
433 int SHUTDOWN_IMMEDIATELY = 81;
434
435 /**
436 * The type of a SHUTDOWN COMPACT statement.
437 */
438 int SHUTDOWN_COMPACT = 82;
439
440 /**
441 * The type of a BEGIN {WORK|TRANSACTION} statement.
442 */
443 int BEGIN = 83;
444
445 /**
446 * The type of a SHUTDOWN DEFRAG statement.
447 */
448 int SHUTDOWN_DEFRAG = 84;
449
450 /**
451 * Get command type.
452 *
453 * @return one of the constants above
454 */
455 int getCommandType();
456
457 /**
458 * Check if this is a query.
459 *
460 * @return true if it is a query
461 */
462 boolean isQuery();
463
464 /**
465 * Get the parameters (if any).
466 *
467 * @return the parameters
468 */
469 ArrayList<? extends ParameterInterface> getParameters();
470
471 /**
472 * Execute the query.
473 *
474 * @param maxRows the maximum number of rows returned
475 * @param scrollable if the result set must be scrollable
476 * @return the result
477 */
478 ResultInterface executeQuery(int maxRows, boolean scrollable);
479
480 /**
481 * Execute the statement
482 *
483 * @return the update count
484 */
485 int executeUpdate();
486
487 /**
488 * Close the statement.
489 */
490 void close();
491
492 /**
493 * Cancel the statement if it is still processing.
494 */
495 void cancel();
496
497 /**
498 * Get an empty result set containing the meta data of the result.
499 *
500 * @return the empty result
501 */
502 ResultInterface getMetaData();
503 }
504