001 /*
002 * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package java.sql;
027
028 /**
029 * <P>The class that defines the constants that are used to identify generic
030 * SQL types, called JDBC types.
031 * <p>
032 * This class is never instantiated.
033 */
034 public class Types {
035
036 /**
037 * <P>The constant in the Java programming language, sometimes referred
038 * to as a type code, that identifies the generic SQL type
039 * <code>BIT</code>.
040 */
041 public final static int BIT = -7;
042
043 /**
044 * <P>The constant in the Java programming language, sometimes referred
045 * to as a type code, that identifies the generic SQL type
046 * <code>TINYINT</code>.
047 */
048 public final static int TINYINT = -6;
049
050 /**
051 * <P>The constant in the Java programming language, sometimes referred
052 * to as a type code, that identifies the generic SQL type
053 * <code>SMALLINT</code>.
054 */
055 public final static int SMALLINT = 5;
056
057 /**
058 * <P>The constant in the Java programming language, sometimes referred
059 * to as a type code, that identifies the generic SQL type
060 * <code>INTEGER</code>.
061 */
062 public final static int INTEGER = 4;
063
064 /**
065 * <P>The constant in the Java programming language, sometimes referred
066 * to as a type code, that identifies the generic SQL type
067 * <code>BIGINT</code>.
068 */
069 public final static int BIGINT = -5;
070
071 /**
072 * <P>The constant in the Java programming language, sometimes referred
073 * to as a type code, that identifies the generic SQL type
074 * <code>FLOAT</code>.
075 */
076 public final static int FLOAT = 6;
077
078 /**
079 * <P>The constant in the Java programming language, sometimes referred
080 * to as a type code, that identifies the generic SQL type
081 * <code>REAL</code>.
082 */
083 public final static int REAL = 7;
084
085 /**
086 * <P>The constant in the Java programming language, sometimes referred
087 * to as a type code, that identifies the generic SQL type
088 * <code>DOUBLE</code>.
089 */
090 public final static int DOUBLE = 8;
091
092 /**
093 * <P>The constant in the Java programming language, sometimes referred
094 * to as a type code, that identifies the generic SQL type
095 * <code>NUMERIC</code>.
096 */
097 public final static int NUMERIC = 2;
098
099 /**
100 * <P>The constant in the Java programming language, sometimes referred
101 * to as a type code, that identifies the generic SQL type
102 * <code>DECIMAL</code>.
103 */
104 public final static int DECIMAL = 3;
105
106 /**
107 * <P>The constant in the Java programming language, sometimes referred
108 * to as a type code, that identifies the generic SQL type
109 * <code>CHAR</code>.
110 */
111 public final static int CHAR = 1;
112
113 /**
114 * <P>The constant in the Java programming language, sometimes referred
115 * to as a type code, that identifies the generic SQL type
116 * <code>VARCHAR</code>.
117 */
118 public final static int VARCHAR = 12;
119
120 /**
121 * <P>The constant in the Java programming language, sometimes referred
122 * to as a type code, that identifies the generic SQL type
123 * <code>LONGVARCHAR</code>.
124 */
125 public final static int LONGVARCHAR = -1;
126
127 /**
128 * <P>The constant in the Java programming language, sometimes referred
129 * to as a type code, that identifies the generic SQL type
130 * <code>DATE</code>.
131 */
132 public final static int DATE = 91;
133
134 /**
135 * <P>The constant in the Java programming language, sometimes referred
136 * to as a type code, that identifies the generic SQL type
137 * <code>TIME</code>.
138 */
139 public final static int TIME = 92;
140
141 /**
142 * <P>The constant in the Java programming language, sometimes referred
143 * to as a type code, that identifies the generic SQL type
144 * <code>TIMESTAMP</code>.
145 */
146 public final static int TIMESTAMP = 93;
147
148 /**
149 * <P>The constant in the Java programming language, sometimes referred
150 * to as a type code, that identifies the generic SQL type
151 * <code>BINARY</code>.
152 */
153 public final static int BINARY = -2;
154
155 /**
156 * <P>The constant in the Java programming language, sometimes referred
157 * to as a type code, that identifies the generic SQL type
158 * <code>VARBINARY</code>.
159 */
160 public final static int VARBINARY = -3;
161
162 /**
163 * <P>The constant in the Java programming language, sometimes referred
164 * to as a type code, that identifies the generic SQL type
165 * <code>LONGVARBINARY</code>.
166 */
167 public final static int LONGVARBINARY = -4;
168
169 /**
170 * <P>The constant in the Java programming language
171 * that identifies the generic SQL value
172 * <code>NULL</code>.
173 */
174 public final static int NULL = 0;
175
176 /**
177 * The constant in the Java programming language that indicates
178 * that the SQL type is database-specific and
179 * gets mapped to a Java object that can be accessed via
180 * the methods <code>getObject</code> and <code>setObject</code>.
181 */
182 public final static int OTHER = 1111;
183
184 /**
185 * The constant in the Java programming language, sometimes referred to
186 * as a type code, that identifies the generic SQL type
187 * <code>JAVA_OBJECT</code>.
188 * @since 1.2
189 */
190 public final static int JAVA_OBJECT = 2000;
191
192 /**
193 * The constant in the Java programming language, sometimes referred to
194 * as a type code, that identifies the generic SQL type
195 * <code>DISTINCT</code>.
196 * @since 1.2
197 */
198 public final static int DISTINCT = 2001;
199
200 /**
201 * The constant in the Java programming language, sometimes referred to
202 * as a type code, that identifies the generic SQL type
203 * <code>STRUCT</code>.
204 * @since 1.2
205 */
206 public final static int STRUCT = 2002;
207
208 /**
209 * The constant in the Java programming language, sometimes referred to
210 * as a type code, that identifies the generic SQL type
211 * <code>ARRAY</code>.
212 * @since 1.2
213 */
214 public final static int ARRAY = 2003;
215
216 /**
217 * The constant in the Java programming language, sometimes referred to
218 * as a type code, that identifies the generic SQL type
219 * <code>BLOB</code>.
220 * @since 1.2
221 */
222 public final static int BLOB = 2004;
223
224 /**
225 * The constant in the Java programming language, sometimes referred to
226 * as a type code, that identifies the generic SQL type
227 * <code>CLOB</code>.
228 * @since 1.2
229 */
230 public final static int CLOB = 2005;
231
232 /**
233 * The constant in the Java programming language, sometimes referred to
234 * as a type code, that identifies the generic SQL type
235 * <code>REF</code>.
236 * @since 1.2
237 */
238 public final static int REF = 2006;
239
240 /**
241 * The constant in the Java programming language, somtimes referred to
242 * as a type code, that identifies the generic SQL type <code>DATALINK</code>.
243 *
244 * @since 1.4
245 */
246 public final static int DATALINK = 70;
247
248 /**
249 * The constant in the Java programming language, somtimes referred to
250 * as a type code, that identifies the generic SQL type <code>BOOLEAN</code>.
251 *
252 * @since 1.4
253 */
254 public final static int BOOLEAN = 16;
255
256 //------------------------- JDBC 4.0 -----------------------------------
257
258 /**
259 * The constant in the Java programming language, sometimes referred to
260 * as a type code, that identifies the generic SQL type <code>ROWID</code>
261 *
262 * @since 1.6
263 *
264 */
265 public final static int ROWID = -8;
266
267 /**
268 * The constant in the Java programming language, sometimes referred to
269 * as a type code, that identifies the generic SQL type <code>NCHAR</code>
270 *
271 * @since 1.6
272 */
273 public static final int NCHAR = -15;
274
275 /**
276 * The constant in the Java programming language, sometimes referred to
277 * as a type code, that identifies the generic SQL type <code>NVARCHAR</code>.
278 *
279 * @since 1.6
280 */
281 public static final int NVARCHAR = -9;
282
283 /**
284 * The constant in the Java programming language, sometimes referred to
285 * as a type code, that identifies the generic SQL type <code>LONGNVARCHAR</code>.
286 *
287 * @since 1.6
288 */
289 public static final int LONGNVARCHAR = -16;
290
291 /**
292 * The constant in the Java programming language, sometimes referred to
293 * as a type code, that identifies the generic SQL type <code>NCLOB</code>.
294 *
295 * @since 1.6
296 */
297 public static final int NCLOB = 2011;
298
299 /**
300 * The constant in the Java programming language, sometimes referred to
301 * as a type code, that identifies the generic SQL type <code>XML</code>.
302 *
303 * @since 1.6
304 */
305 public static final int SQLXML = 2009;
306
307 // Prevent instantiation
308 private Types() {
309 }
310 }
|