KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hsqldb > ResultConstants


1 /* Copyright (c) 2001-2005, The HSQL Development Group
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * Neither the name of the HSQL Development Group nor the names of its
15  * contributors may be used to endorse or promote products derived from this
16  * software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
22  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */

30
31
32 package org.hsqldb;
33
34 // This can probably just be merged with Result.
35

36 /**
37  * An enumeration of the request and response mode values used to communicate
38  * between the client and the engine when sending Result objects back
39  * and forth.
40  *
41  * @author boucherb@users
42  * @since 1.7.2
43  * @version 1.7.2
44  */

45 // fredt@users - the constants from the SQL standards are used freely where a
46
// similar function is performed. The Result objects do not necessarily contain
47
// the same information as stated in SQL standard for CLI.
48
public interface ResultConstants {
49
50     /** The offset at which HSQLDB API Result mode values start. */
51     int HSQL_API_BASE = 0;
52
53     /**
54      * Indicates that the Result object encapsulates multiple Result objects.
55      */

56     int MULTI = HSQL_API_BASE + 0;
57
58     /**
59      * Indicates that the Result object encapsulates an update
60      * count response.
61      */

62     int UPDATECOUNT = HSQL_API_BASE + 1;
63
64     /**
65      * Indicates that the Result object encapsualtes an
66      * error response.
67      */

68     int ERROR = HSQL_API_BASE + 2;
69
70     /**
71      * Indicates that the Result object encapsulates a result
72      * set response containing data.
73      */

74     int DATA = HSQL_API_BASE + 3;
75
76     /**
77      * Indicates that the Result object encapsulates a response
78      * that communicates the acknowlegement of newly allocated
79      * CompiledStatement object in the form of its statementID.
80      */

81     int PREPARE_ACK = HSQL_API_BASE + 4;
82
83     /**
84      * Indicates that the Result object encapsulates a result
85      * set response containing parameter metadata.
86      */

87     int PARAM_META_DATA = HSQL_API_BASE + 5;
88
89     /**
90      * Indicates that the Result object encapsulates a result
91      * set for setting session attributes.
92      */

93     int SETSESSIONATTR = HSQL_API_BASE + 6;
94
95     /**
96      * Indicates that the Result object encapsulates a request
97      * to get session attributes.
98      */

99     int GETSESSIONATTR = HSQL_API_BASE + 7;
100
101     /**
102      * Indicates that the Result object encapsulates a batch of statements
103      */

104     int BATCHEXECDIRECT = HSQL_API_BASE + 8;
105
106     /**
107      * Indicates that the Result object encapsulates a batch of prepared
108      * statement parameter values
109      */

110     int BATCHEXECUTE = HSQL_API_BASE + 9;
111
112     /**
113      * Indicates that the Result object encapsulates a request to start a new
114      * internal session for the connection
115      */

116     int HSQLRESETSESSION = HSQL_API_BASE + 10;
117
118     /**
119      * Indicates that the Result object encapsulates a request to prepare
120      * to commit as the first phase of a two-phase commit
121      */

122     int HSQLPREPARECOMMIT = HSQL_API_BASE + 11;
123
124     /** The offset at which the standard SQL API Result mode values start. */
125     int SQL_API_BASE = 0x00010000;
126
127 // /**
128
// * Indicates that Result encapsulates a request to allocate an
129
// * SQL-connection and assign a handle to it.
130
// */
131
// int SQLALLOCCONNECT = SQL_API_BASE + 1;
132
// /**
133
// * Indicates that Result encapsulates a request to allocate an
134
// * SQL-environment and assign a handle to it.
135
// */
136
// int SQLALLOCENV = SQL_API_BASE + 2;
137
//
138
// /**
139
// * Indicates that Result encapsulates a request to allocate a resource
140
// * and assign a handle to it.
141
// */
142
// int SQLALLOCHANDLE = SQL_API_BASE + 1001;
143
//
144
// /**
145
// * Indicates that Result encapsulates a request to allocate an
146
// * SQL-statement and assign a handle to it.
147
// */
148
// int SQLALLOCSTMT = SQL_API_BASE + 3;
149
//
150
// /**
151
// * Indicates that Result encapsulates a request to describe a target
152
// * specification or array of target specifications.
153
// */
154
// int SQLBINDCOL = SQL_API_BASE + 4;
155
//
156
// /**
157
// * Indicates that Result encapsulates a request to describe a
158
// * dynamic parameter specification and its value.
159
// */
160
// int SQLBINDPARAMETER = SQL_API_BASE + 72;
161
//
162
// /**
163
// * Indicates that Result encapsulates a request to cancel execution of
164
// * a CLI routine.
165
// */
166
// int SQLCANCEL = SQL_API_BASE + 5;
167
//
168
// /** Indicates that Result encapsulates a request to close a cursor. */
169
// int SQLCLOSECURSOR = SQL_API_BASE + 1003;
170
//
171
// /**
172
// * Indicates that Result encapsulates a request to get a
173
// * column attribute.
174
// */
175
// int SQLCOLATTRIBUTE = SQL_API_BASE + 6;
176
//
177
// /**
178
// * Indicates that Result encapsulates a request to return a result set that
179
// * contains a list of the privileges held on the columns whose names adhere
180
// * to the requested pattern or patterns within a single specified table
181
// * stored in the Information Schema of the connected data source.
182
// */
183
// int SQLCOLUMNPRIVILEGES = SQL_API_BASE + 56;
184
//
185
// /**
186
// * Indicates that Result encapsulates a request to, based on the specified
187
// * selection criteria, return a result set that contains information about
188
// * columns of tables stored in the information schemas of the connected
189
// * data source.
190
// */
191
// int SQLCOLUMNS = SQL_API_BASE + 40;
192
//
193

194     /**
195      * Indicates that Result encapsulates a request to establish a connection.
196      */

197     int SQLCONNECT = SQL_API_BASE + 7;
198
199 // /**
200
// * Indicates that Result encapsulates a request to copy a CLI descriptor.
201
// */
202
// int SQLCOPYDESC = SQL_API_BASE + 1004;
203
//
204
// /**
205
// * Indicates that Result encapsulates a request to get server name(s) that
206
// * the application can connect to, along with description information,
207
// * if available.
208
// */
209
// int SQLDATASOURCES = SQL_API_BASE + 57;
210
//
211
// /**
212
// * Indicates that Result encapsulates a request to get column attributes.
213
// */
214
// int SQLDESCRIBECOL = SQL_API_BASE + 8;
215
//
216

217     /**
218      * Indicates that Result encapsulates a request to terminate an
219      * established connection.
220      */

221     int SQLDISCONNECT = SQL_API_BASE + 9;
222
223     /**
224      * Indicates that Result encapsulates a request to terminate an
225      * SQL-transaction.
226      */

227     int SQLENDTRAN = SQL_API_BASE + 1005;
228
229 // /**
230
// * Indicates that Result encapsulates a request to return diagnostic
231
// * information.
232
// */
233
// int SQLERROR = SQL_API_BASE + 10;
234

235     /**
236      * Indicates that Result encapsulates a request to execute a statement
237      * directly.
238      */

239     int SQLEXECDIRECT = SQL_API_BASE + 11;
240
241     /**
242      * Indicates that Result encapsulates a request to execute a prepared
243      * statement.
244      */

245     int SQLEXECUTE = SQL_API_BASE + 12;
246
247     /**
248      * Indicates that Result encapsulates a request to fetch the next row of
249      * a cursor.
250      */

251
252 // int SQLFETCH = SQL_API_BASE + 13;
253

254     /**
255      * Indicates that Result encapsulates a request to position a cursor on
256      * the specified row and retrieve values from that row.
257      */

258 // int SQLFETCHSCROLL = SQL_API_BASE + 1021;
259
// /**
260
// * Indicates that Result encapsulates a request to return a result set
261
// * that contains information about foreign keys either in or referencing
262
// * a single specified table stored in the Information Schema of the
263
// * connected data source.
264
// */
265
// int SQLFOREIGNKEYS = SQL_API_BASE + 60;
266
//
267
// /**
268
// * Indicates that Result encapsulates a request to deallocate an
269
// * SQL-connection.
270
// */
271
// int SQLFREECONNECT = SQL_API_BASE + 14;
272
//
273
// /**
274
// * Indicates that Result encapsulates a request to deallocate an
275
// * SQL-environment.
276
// */
277
// int SQLFREEENV = SQL_API_BASE + 15;
278
//
279
// /**
280
// * Indicates that Result encapsulates a request to free a resource.
281
// */
282
// int SQLFREEHANDLE = SQL_API_BASE + 1006;
283

284     /**
285      * Indicates that Result encapsulates a request to deallocate an
286      * SQL-statement.
287      */

288     int SQLFREESTMT = SQL_API_BASE + 16;
289
290 // /**
291
// * Indicates that Result encapsulates a request to get the value of an
292
// * SQL-connection attribute.
293
// */
294
// int SQLGETCONNECTATTR = SQL_API_BASE + 1007;
295
//
296
// /**
297
// * Indicates that Result encapsulates a request to get a cursor name.
298
// */
299
// int SQLGETCURSORNAME = SQL_API_BASE + 17;
300
//
301
// /**
302
// * Indicates that Result encapsulates a request to retrieve a column value.
303
// */
304
// int SQLGETDATA = SQL_API_BASE + 43;
305
//
306
// /**
307
// * Indicates that Result encapsulates a request to get a field from a CLI
308
// * descriptor area.
309
// */
310
// int SQLGETDESCFIELD = SQL_API_BASE + 1008;
311
//
312
// /**
313
// * Indicates that Result encapsulates a request to get commonly-used
314
// * fields from a CLI descriptor area.
315
// */
316
// int SQLGETDESCREC = SQL_API_BASE + 1009;
317
//
318
// /**
319
// * Indicates that Result encapsulates a request to get information from a
320
// * CLI diagnostics area.
321
// */
322
// int SQLGETDIAGFIELD = SQL_API_BASE + 1010;
323
//
324
// /** Indicates that Result encapsulates a request to get commonly-used
325
// * information from a CLI diagnostics area.
326
// */
327
// int SQLGETDIAGREC = SQL_API_BASE + 1011;
328
//
329
// /**
330
// * Indicates that Result encapsulates a request to get the value of an
331
// * SQL-environment attribute.
332
// */
333
// int SQLGETENVATTR = SQL_API_BASE + 1012;
334
//
335
// /**
336
// * Indicates that Result encapsulates a request to get information
337
// * about features supported by the CLI implementation.
338
// */
339
// int SQLGETFEATUREINFO = SQL_API_BASE + 1027;
340
//
341
// /**
342
// * Indicates that Result encapsulates a request to determine whether a CLI
343
// * routine is supported.
344
// */
345
// int SQLGETFUNCTIONS = SQL_API_BASE + 44;
346
//
347
// /**
348
// * Indicates that Result encapsulates a request to get information about
349
// * the implementation.
350
// */
351
// int SQLGETINFO = SQL_API_BASE + 45;
352
//
353
// /**
354
// * Indicates that Result encapsulates a request to retrieve the length of
355
// * the character or octet string value represented by a Large Object
356
// * locator.
357
// */
358
// int SQLGETLENGTH = SQL_API_BASE + 1022;
359
//
360
// /**
361
// * Indicates that Result encapsulates a request to retrieve the value of a
362
// * dynamic output parameter.
363
// */
364
// int SQLGETPARAMDATA = SQL_API_BASE + 1025;
365
//
366
// /**
367
// * Indicates that Result encapsulates a request to retrieve the starting
368
// * position of a string value within another string value, where the second
369
// * string value is represented by a Large Object locator.
370
// */
371
// int SQLGETPOSITION = SQL_API_BASE + 1023;
372
//
373

374     /**
375      * Indicates that Result encapsulates a request to get information about
376      * general value specifications supported by the implementation.
377      */

378 // int SQLGETSESSIONINFO = SQL_API_BASE + 1028;
379
// /**
380
// * Indicates that Result encapsulates a request to get the value of an
381
// * SQL-statement attribute.
382
// */
383
// int SQLGETSTMTATTR = SQL_API_BASE + 1014;
384
//
385
// /**
386
// * Indicates that Result encapsulates a request to either retrieve a
387
// * portion of a character or octet string value that is represented by
388
// * a Large Object locator or create a Large Object value at the server
389
// * and retrieve a Large Object locator for that value.
390
// */
391
// int SQLGETSUBSTRING = SQL_API_BASE + 1024;
392
//
393
// /**
394
// * Indicates that Result encapsulates a request to get information about
395
// * one or all of the predefined data types supported by the implementation.
396
// */
397
// int SQLGETTYPEINFO = SQL_API_BASE + 47;
398

399     /**
400      * Indicates that Result encapsulates a request to determine whether there
401      * are more result sets available on a statement handle and, if there are,
402      * initialize processing for those result sets.
403      */

404 // int SQLMORERESULTS = SQL_API_BASE + 61;
405

406     /**
407      * Indicates that Result encapsulates a request to determine whether there
408      * are more result sets available on a statement handle and, if there are,
409      * initialize processing for the next result set on a separate statement
410      * handle.
411      */

412 // int SQLNEXTRESULT = SQL_API_BASE + 73;
413
// /**
414
// * Indicates that Result encapsulates a request to get the number of
415
// * result columns of a prepared or executed statement.
416
// */
417
// int SQLNUMRESULTCOLS = SQL_API_BASE + 18;
418
// /**
419
// * Indicates that Result encapsulates a request to process a deferred
420
// * parameter value. For example, a streamed or locator identified
421
// * parameter.
422
// */
423
// int SQLPARAMDATA = SQL_API_BASE + 48;
424

425     /**
426      * Indicates that Result encapsulates a request to prepare a statement.
427      */

428     int SQLPREPARE = SQL_API_BASE + 19;
429
430 // /**
431
// * Indicates that Result encapsulates a request to return a result set that
432
// * contains a list of the column names that comprise the primary key for a
433
// * single specified table stored in the information schemas of the
434
// * connected data source.
435
// */
436
// int SQLPRIMARYKEYS = SQL_API_BASE + 65;
437
//
438
// /**
439
// * Indicates that Result encapsulates a request to provide a deferred
440
// * parameter value. For example, a streamed or locator-identified
441
// * parameter.
442
// */
443
// int SQLPUTDATA = SQL_API_BASE + 49;
444

445     /**
446      * Indicates that Result encapsulates a request to get the row count of an
447      * executed statement.
448      */

449 // int SQLROWCOUNT = SQL_API_BASE + 20;
450

451     /**
452      * Indicates that Result encapsulates a request to set the value of an
453      * SQL-connection attribute.
454      */

455     int SQLSETCONNECTATTR = SQL_API_BASE + 1016;
456
457 //
458
// /** Indicates that Result encapsulates a request to set a cursor name. */
459
// int SQLSETCURSORNAME = SQL_API_BASE + 21;
460
//
461
// /**
462
// * Indicates that Result encapsulates a request to set a field in a CLI
463
// * descriptor area.
464
// */
465
// int SQLSETDESCFIELD = SQL_API_BASE + 1017;
466
//
467
// /**
468
// * Indicates that Result encapsulates a request to set commonly-used
469
// * fields in a CLI descriptor area.
470
// */
471
// int SQLSETDESCREC = SQL_API_BASE + 1018;
472
//
473

474     /**
475      * Indicates that Result encapsulates a request to set the value of an
476      * SQL-environment attribute.
477      */

478 // int SQLSETENVATTR = SQL_API_BASE + 1019;
479
// /** Indicates that Result encapsulates a request to set the value of an
480
// * SQL-statement attribute.
481
// */
482
// int SQLSETSTMTATTR = SQL_API_BASE + 1020;
483
//
484
// /**
485
// * Indicates that Result encapsulates a request to return a result set that
486
// * contains a list of columns the combined values of which can uniquely
487
// * identify any row within a single specified table described by the
488
// * Information Schemas of the connected data source.
489
// */
490
// int SQLSPECIALCOLUMNS = SQL_API_BASE + 52;
491
//
492

493     /**
494      * Indicates that Result encapsulates a request to explicitly start an
495      * SQL-transaction and set its characteristics.
496      */

497     int SQLSTARTTRAN = SQL_API_BASE + 74;
498
499 // /**
500
// * Indicates that Result encapsulates a request to return a result set that
501
// * contains a list of the privileges held on the tables whose names adhere
502
// * to the requested pattern(s) within tables described by the Information
503
// * Schemas of the connected data source.
504
// */
505
// int SQLTABLES = SQL_API_BASE + 54;
506
//
507
// /**
508
// * Indicates that Result encapsulates a request to, based on the specified
509
// * selection criteria, return a result set that contains information about
510
// * tables described by the Information Schema of the connected data source.
511
// */
512
// int SQLTABLEPRIVILEGES = SQL_API_BASE + 70;
513
/*
514      Codes for transaction termination:
515
516      COMMIT 0
517      ROLLBACK 1
518      SAVEPOINT NAME ROLLBACK 2
519      SAVEPOINT NAME RELEASE 4
520      COMMIT AND CHAIN 6
521      ROLLBACK AND CHAIN 7
522      Implementation-defined termination type <0
523      */

524     int COMMIT = 0;
525     int ROLLBACK = 1;
526     int SAVEPOINT_NAME_ROLLBACK = 2;
527     int SAVEPOINT_NAME_RELEASE = 4;
528     int COMMIT_AND_CHAIN = 6;
529     int ROLLBACK_AND_CHAIN = 7;
530
531 /* Environment attributes */
532
533 //#define SQL_ATTR_OUTPUT_NTS 10001
534

535 /* Connection attributes */
536
537 //#define SQL_ATTR_AUTO_IPD 10001
538
//#define SQL_ATTR_SAVEPOINT_NAME 10027
539
int SQL_ATTR_SAVEPOINT_NAME = 10027;
540
541 // Batched execution constants:
542

543     /** batch item failed */
544     int EXECUTE_FAILED = -3;
545
546     /**
547      * Batch item succeeded but does not generate an update count,
548      * for example a call having no return value
549      */

550     int SUCCESS_NO_INFO = -2;
551 }
552
Popular Tags