KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > client > net > FdocaConstants


1 /*
2
3    Derby - Class org.apache.derby.client.net.FdocaConstants
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20 */

21 package org.apache.derby.client.net;
22
23 class FdocaConstants {
24
25 // PROTOCOL FD:OCA constants.
26
static final int FDOCA_TYPE_FIXEDBYTES = 0x01;
27     static final int FDOCA_TYPE_NFIXEDBYTES = 0x81;
28     static final int FDOCA_TYPE_VARBYTES = 0x02;
29     static final int FDOCA_TYPE_NVARBYTES = 0x82;
30     static final int FDOCA_TYPE_NTBYTES = 0x03;
31     static final int FDOCA_TYPE_NNTBYTES = 0x83;
32     static final int FDOCA_TYPE_PSCLBYTE = 0x07;
33     static final int FDOCA_TYPE_NPSCLBYTE = 0x87;
34     static final int FDOCA_TYPE_FIXEDCHAR = 0x10;
35     static final int FDOCA_TYPE_NFIXEDCHAR = 0x90;
36     static final int FDOCA_TYPE_VARCHAR = 0x11;
37     static final int FDOCA_TYPE_NVARCHAR = 0x91;
38     static final int FDOCA_TYPE_NTCHAR = 0x14;
39     static final int FDOCA_TYPE_NNTCHAR = 0x94;
40     static final int FDOCA_TYPE_PSCLCHAR = 0x19;
41     static final int FDOCA_TYPE_NPSCLCHAR = 0x99;
42     static final int FDOCA_TYPE_INTEGER_BE = 0x23;
43     static final int FDOCA_TYPE_NINTEGER_BE = 0xA3;
44     static final int FDOCA_TYPE_INTEGER_LE = 0x24;
45     static final int FDOCA_TYPE_NINTEGER_LE = 0xA4;
46     static final int FDOCA_TYPE_DECIMAL = 0x30;
47     static final int FDOCA_TYPE_NDECIMAL = 0xB0;
48     static final int FDOCA_TYPE_NUMERIC_CHAR = 0x32;
49     static final int FDOCA_TYPE_NNUMERIC_CHAR = 0xB2;
50     static final int FDOCA_TYPE_FLOAT_X86 = 0x47;
51     static final int FDOCA_TYPE_NFLOAT_X86 = 0xC7;
52     static final int FDOCA_TYPE_FLOAT_IEEE = 0x48;
53     static final int FDOCA_TYPE_NFLOAT_IEEE = 0xC8;
54     static final int FDOCA_TYPE_LOBBYTES = 0x50;
55     static final int FDOCA_TYPE_NLOBBYTES = 0xD0;
56     static final int FDOCA_TYPE_LOBCHAR = 0x51;
57     static final int FDOCA_TYPE_NLOBCHAR = 0xD1;
58
59     // --- Override LIDs 0x50 - 0xAF
60
static final int FIRST_OVERRIDE_LID = 0x50;
61     static final int LAST_OVERRIDE_LID = 0xAF;
62
63     static final int CPT_TRIPLET_TYPE = 0x7F; // CPT triplet type
64
static final int MDD_TRIPLET_TYPE = 0x78; // MDD triplet type
65
static final int NGDA_TRIPLET_TYPE = 0x76; // N-GDA triplet type
66
static final int RLO_TRIPLET_TYPE = 0x71; // RLO triplet type
67
static final int SDA_TRIPLET_TYPE = 0x70; // SDA triplet type
68

69     static final int SQLDTARD_LID = 0xF0;
70     static final int SQLCADTA_LID = 0xE0;
71     static final int SQLDTAGRP_LID = 0xD0; // SQLDTAGRP LID
72
static final int NULL_LID = 0x00;
73
74     static final int INDICATOR_NULLABLE = 0x00;
75     static final int NULL_DATA = 0xFF;
76
77     static final int MAX_VARS_IN_NGDA = 84; // Number of SQLVARs in full SQLDTAGRP
78
// N-GDA or CPT
79
static final int MDD_TRIPLET_SIZE = 7; // Size of MDD triplet
80
static final int SQLDTARD_RLO_SIZE = 6; // size of SQLDTARD minus MDD
81
static final int SQLCADTA_RLO_SIZE = 9; // size of SQLCDTA minus MDD
82
static final int SDA_TRIPLET_SIZE = 12; // Size of SDA triplet
83
static final int SQLDTAGRP_SIZE = 3; // Size of SQLDTAGRP descriptor
84
static final int CPT_SIZE = 3; // Size of CPT descriptor
85
static final int SQLDTAGRP_COL_DSC_SIZE = 3; // Env. LID & len. bytes
86
static final int MDD_REST_SIZE = 5; // Size of the MDD group minus length and type
87

88     static final int MDD_SDA_TRIPLET_SIZE = 19;
89     static final int MDD_SDA_PROTOCOLTYPE_OFFSET = 6;
90     static final int MDD_SDA_FDOCALID_OFFSET = 9;
91     static final int MDD_SDA_FDOCATYPE_OFFSET = 10;
92     static final int MDD_SDA_CCSID_OFFSET = 11;
93     static final int MDD_SDA_LENGTH_OFFSET = 17;
94
95     static final byte[] defaultMddSdaBytes = {
96         (byte) 0x07, (byte) 0x78, (byte) 0x00, (byte) 0x05,
97         (byte) 0x01, (byte) 0x01, (byte) 0x00, // protocol type
98
(byte) 0x0C, (byte) 0x70, (byte) 0x00, // fdoca triplet lid
99
(byte) 0x00, // fdoca field type
100
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // ccsid
101
(byte) 0x01, (byte) 0x01,
102         (byte) 0x7F, (byte) 0xFF // length
103
};
104
105     static final byte[] MDD_SQLDTAGRP_TOSEND = {
106         (byte) 0x07, (byte) 0x78, (byte) 0x00, (byte) 0x05,
107         (byte) 0x02, (byte) 0x01, (byte) 0xD0
108     };
109
110     static final byte[] MDD_SQLDTA_TOSEND = {
111         (byte) 0x07, (byte) 0x78, (byte) 0x00, (byte) 0x05,
112         (byte) 0x03, (byte) 0x01, (byte) 0xE4
113     };
114
115     // Hard-coded SQLDTA RLO
116
static final byte[] SQLDTA_RLO_TOSEND = {
117         (byte) 0x06, (byte) 0x71, (byte) 0xE4,
118         (byte) 0xD0, (byte) 0x00, (byte) 0x01
119     };
120
121     // Hard-coded SQLCADTA RLO
122
static final byte[] SQLCADTA_RLO_TOSEND = {
123         (byte) 0x09, (byte) 0x71, (byte) 0xE0,
124         (byte) 0x54, (byte) 0x00, (byte) 0x01,
125         (byte) 0xD0, (byte) 0x00, (byte) 0x01
126     };
127
128     // Hard-coded SQLDTARD RLO
129
static final byte[] SQLDTARD_RLO_TOSEND = {
130         (byte) 0X06, (byte) 0X71, (byte) 0xF0,
131         (byte) 0xE0, (byte) 0x00, (byte) 0x00
132     };
133
134     // following code added for parseSQLDTARD prototype
135
static final int SQLDTARD_TRIPLET_TYPE_START = 0;
136     static final int SQLDTARD_TRIPLET_TYPE_END = 1;
137     static final int SQLDTARD_TRIPLET_TYPE_MDD = 2;
138     static final int SQLDTARD_TRIPLET_TYPE_SDA = 3;
139     static final int SQLDTARD_TRIPLET_TYPE_RLO = 4;
140     static final int SQLDTARD_TRIPLET_TYPE_GDA = 5;
141     static final int SQLDTARD_TRIPLET_TYPE_CPT = 6;
142
143     static final boolean[][] SQLDTARD_TRIPLET_TYPES = {
144         // /*START*/, /*END*/, /*MDD*/, /*SDA*/, /*RLO*/, /*GDA*/, /*CPT*/ // next ->
145
/*START*/ {false, false, true, false, false, true, false},
146 /* END */ {false, false, false, false, false, false, false},
147 /* MDD */ {false, false, false, true, true, true, false}, // |
148
/* SDA */ {false, false, true, false, false, false, false}, // previous |
149
/* RLO */ {false, true, true, false, true, false, false}, // \ /
150
/* GDA */ {false, false, true, false, true, false, true},
151 /* CPT */ {false, false, true, false, true, false, true}};
152
153     static final int SQLDTARD_TRIPLET_ID_START = 0;
154     static final int SQLDTARD_TRIPLET_ID_END = 1;
155     static final int SQLDTARD_TRIPLET_ID_SDA = 2;
156     static final int SQLDTARD_TRIPLET_ID_0 = 3;
157     static final int SQLDTARD_TRIPLET_ID_D0 = 4;
158     static final int SQLDTARD_TRIPLET_ID_E0 = 5;
159     static final int SQLDTARD_TRIPLET_ID_F0 = 6;
160
161     static final boolean[][] SQLDTARD_TRIPLET_IDS = {
162         // /*START*/, /*END*/, /*SDA*/, /*0*/, /*D0*/, /*E0*/, /*F4*/ // next ->
163
/*START*/ {false, false, false, true, true, false, false},
164 /* END */ {false, false, false, false, false, false, false},
165 /* SDA */ {false, false, false, true, false, false, false},
166 /* 0 */ {false, false, true, true, true, true, true},
167 /* D0 */ {false, false, false, true, false, true, false},
168 /* E0 */ {false, false, false, true, false, false, true},
169 /* F4 */ {false, true, false, false, false, false, false}};
170
171     static final int RLO_GROUP_LID = 0;
172     static final int RLO_ELEMENT_TAKEN = 1;
173     static final int RLO_REP_FACTOR = 2;
174
175     static final int[][] RLO_SQLCADTA = {// GROUP LID , ELEM TAKEN, REP_FACTOR
176
{0x54, 0, 1},
177         {0xD0, 0, 1}};
178
179     static final int[][] RLO_SQLDTARD = {// GROUP LID , ELEM TAKEN, REP_FACTOR
180
{0xE0, 0, 0}};
181
182 }
183
Popular Tags