1 /*
2  * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package java.sql;
27 
28 /**
29  * <P>The class that defines the constants that are used to identify generic
30  * SQL types, called JDBC types.
31  * <p>
32  * This class is never instantiated.
33  *
34  * @since 1.1
35  */
36 public class Types {
37 
38 /**
39  * <P>The constant in the Java programming language, sometimes referred
40  * to as a type code, that identifies the generic SQL type
41  * {@code BIT}.
42  */
43         public final static int BIT             =  -7;
44 
45 /**
46  * <P>The constant in the Java programming language, sometimes referred
47  * to as a type code, that identifies the generic SQL type
48  * {@code TINYINT}.
49  */
50         public final static int TINYINT         =  -6;
51 
52 /**
53  * <P>The constant in the Java programming language, sometimes referred
54  * to as a type code, that identifies the generic SQL type
55  * {@code SMALLINT}.
56  */
57         public final static int SMALLINT        =   5;
58 
59 /**
60  * <P>The constant in the Java programming language, sometimes referred
61  * to as a type code, that identifies the generic SQL type
62  * {@code INTEGER}.
63  */
64         public final static int INTEGER         =   4;
65 
66 /**
67  * <P>The constant in the Java programming language, sometimes referred
68  * to as a type code, that identifies the generic SQL type
69  * {@code BIGINT}.
70  */
71         public final static int BIGINT          =  -5;
72 
73 /**
74  * <P>The constant in the Java programming language, sometimes referred
75  * to as a type code, that identifies the generic SQL type
76  * {@code FLOAT}.
77  */
78         public final static int FLOAT           =   6;
79 
80 /**
81  * <P>The constant in the Java programming language, sometimes referred
82  * to as a type code, that identifies the generic SQL type
83  * {@code REAL}.
84  */
85         public final static int REAL            =   7;
86 
87 
88 /**
89  * <P>The constant in the Java programming language, sometimes referred
90  * to as a type code, that identifies the generic SQL type
91  * {@code DOUBLE}.
92  */
93         public final static int DOUBLE          =   8;
94 
95 /**
96  * <P>The constant in the Java programming language, sometimes referred
97  * to as a type code, that identifies the generic SQL type
98  * {@code NUMERIC}.
99  */
100         public final static int NUMERIC         =   2;
101 
102 /**
103  * <P>The constant in the Java programming language, sometimes referred
104  * to as a type code, that identifies the generic SQL type
105  * {@code DECIMAL}.
106  */
107         public final static int DECIMAL         =   3;
108 
109 /**
110  * <P>The constant in the Java programming language, sometimes referred
111  * to as a type code, that identifies the generic SQL type
112  * {@code CHAR}.
113  */
114         public final static int CHAR            =   1;
115 
116 /**
117  * <P>The constant in the Java programming language, sometimes referred
118  * to as a type code, that identifies the generic SQL type
119  * {@code VARCHAR}.
120  */
121         public final static int VARCHAR         =  12;
122 
123 /**
124  * <P>The constant in the Java programming language, sometimes referred
125  * to as a type code, that identifies the generic SQL type
126  * {@code LONGVARCHAR}.
127  */
128         public final static int LONGVARCHAR     =  -1;
129 
130 
131 /**
132  * <P>The constant in the Java programming language, sometimes referred
133  * to as a type code, that identifies the generic SQL type
134  * {@code DATE}.
135  */
136         public final static int DATE            =  91;
137 
138 /**
139  * <P>The constant in the Java programming language, sometimes referred
140  * to as a type code, that identifies the generic SQL type
141  * {@code TIME}.
142  */
143         public final static int TIME            =  92;
144 
145 /**
146  * <P>The constant in the Java programming language, sometimes referred
147  * to as a type code, that identifies the generic SQL type
148  * {@code TIMESTAMP}.
149  */
150         public final static int TIMESTAMP       =  93;
151 
152 
153 /**
154  * <P>The constant in the Java programming language, sometimes referred
155  * to as a type code, that identifies the generic SQL type
156  * {@code BINARY}.
157  */
158         public final static int BINARY          =  -2;
159 
160 /**
161  * <P>The constant in the Java programming language, sometimes referred
162  * to as a type code, that identifies the generic SQL type
163  * {@code VARBINARY}.
164  */
165         public final static int VARBINARY       =  -3;
166 
167 /**
168  * <P>The constant in the Java programming language, sometimes referred
169  * to as a type code, that identifies the generic SQL type
170  * {@code LONGVARBINARY}.
171  */
172         public final static int LONGVARBINARY   =  -4;
173 
174 /**
175  * <P>The constant in the Java programming language
176  * that identifies the generic SQL value
177  * {@code NULL}.
178  */
179         public final static int NULL            =   0;
180 
181     /**
182      * The constant in the Java programming language that indicates
183      * that the SQL type is database-specific and
184      * gets mapped to a Java object that can be accessed via
185      * the methods {@code getObject} and {@code setObject}.
186      */
187         public final static int OTHER           = 1111;
188 
189 
190 
191     /**
192      * The constant in the Java programming language, sometimes referred to
193      * as a type code, that identifies the generic SQL type
194      * {@code JAVA_OBJECT}.
195      * @since 1.2
196      */
197         public final static int JAVA_OBJECT         = 2000;
198 
199     /**
200      * The constant in the Java programming language, sometimes referred to
201      * as a type code, that identifies the generic SQL type
202      * {@code DISTINCT}.
203      * @since 1.2
204      */
205         public final static int DISTINCT            = 2001;
206 
207     /**
208      * The constant in the Java programming language, sometimes referred to
209      * as a type code, that identifies the generic SQL type
210      * {@code STRUCT}.
211      * @since 1.2
212      */
213         public final static int STRUCT              = 2002;
214 
215     /**
216      * The constant in the Java programming language, sometimes referred to
217      * as a type code, that identifies the generic SQL type
218      * {@code ARRAY}.
219      * @since 1.2
220      */
221         public final static int ARRAY               = 2003;
222 
223     /**
224      * The constant in the Java programming language, sometimes referred to
225      * as a type code, that identifies the generic SQL type
226      * {@code BLOB}.
227      * @since 1.2
228      */
229         public final static int BLOB                = 2004;
230 
231     /**
232      * The constant in the Java programming language, sometimes referred to
233      * as a type code, that identifies the generic SQL type
234      * {@code CLOB}.
235      * @since 1.2
236      */
237         public final static int CLOB                = 2005;
238 
239     /**
240      * The constant in the Java programming language, sometimes referred to
241      * as a type code, that identifies the generic SQL type
242      * {@code REF}.
243      * @since 1.2
244      */
245         public final static int REF                 = 2006;
246 
247     /**
248      * The constant in the Java programming language, sometimes referred to
249      * as a type code, that identifies the generic SQL type {@code DATALINK}.
250      *
251      * @since 1.4
252      */
253     public final static int DATALINK = 70;
254 
255     /**
256      * The constant in the Java programming language, sometimes referred to
257      * as a type code, that identifies the generic SQL type {@code BOOLEAN}.
258      *
259      * @since 1.4
260      */
261     public final static int BOOLEAN = 16;
262 
263     //------------------------- JDBC 4.0 -----------------------------------
264 
265     /**
266      * The constant in the Java programming language, sometimes referred to
267      * as a type code, that identifies the generic SQL type {@code ROWID}
268      *
269      * @since 1.6
270      *
271      */
272     public final static int ROWID = -8;
273 
274     /**
275      * The constant in the Java programming language, sometimes referred to
276      * as a type code, that identifies the generic SQL type {@code NCHAR}
277      *
278      * @since 1.6
279      */
280     public static final int NCHAR = -15;
281 
282     /**
283      * The constant in the Java programming language, sometimes referred to
284      * as a type code, that identifies the generic SQL type {@code NVARCHAR}.
285      *
286      * @since 1.6
287      */
288     public static final int NVARCHAR = -9;
289 
290     /**
291      * The constant in the Java programming language, sometimes referred to
292      * as a type code, that identifies the generic SQL type {@code LONGNVARCHAR}.
293      *
294      * @since 1.6
295      */
296     public static final int LONGNVARCHAR = -16;
297 
298     /**
299      * The constant in the Java programming language, sometimes referred to
300      * as a type code, that identifies the generic SQL type {@code NCLOB}.
301      *
302      * @since 1.6
303      */
304     public static final int NCLOB = 2011;
305 
306     /**
307      * The constant in the Java programming language, sometimes referred to
308      * as a type code, that identifies the generic SQL type {@code XML}.
309      *
310      * @since 1.6
311      */
312     public static final int SQLXML = 2009;
313 
314     //--------------------------JDBC 4.2 -----------------------------
315 
316     /**
317      * The constant in the Java programming language, sometimes referred to
318      * as a type code, that identifies the generic SQL type {@code REF CURSOR}.
319      *
320      * @since 1.8
321      */
322     public static final int REF_CURSOR = 2012;
323 
324     /**
325      * The constant in the Java programming language, sometimes referred to
326      * as a type code, that identifies the generic SQL type
327      * {@code TIME WITH TIMEZONE}.
328      *
329      * @since 1.8
330      */
331     public static final int TIME_WITH_TIMEZONE = 2013;
332 
333     /**
334      * The constant in the Java programming language, sometimes referred to
335      * as a type code, that identifies the generic SQL type
336      * {@code TIMESTAMP WITH TIMEZONE}.
337      *
338      * @since 1.8
339      */
340     public static final int TIMESTAMP_WITH_TIMEZONE = 2014;
341 
342     // Prevent instantiation
Types()343     private Types() {}
344 }
345