J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1996-2006 Sun Microsystems, Inc. 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. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any 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 | public class Types { |
| 35 | |
| 36 | /** |
| 37 | * <P>The constant in the Java programming language, sometimes referred |
| 38 | * to as a type code, that identifies the generic SQL type |
| 39 | * <code>BIT</code>. |
| 40 | */ |
| 41 | public final static int BIT = -7; |
| 42 | |
| 43 | /** |
| 44 | * <P>The constant in the Java programming language, sometimes referred |
| 45 | * to as a type code, that identifies the generic SQL type |
| 46 | * <code>TINYINT</code>. |
| 47 | */ |
| 48 | public final static int TINYINT = -6; |
| 49 | |
| 50 | /** |
| 51 | * <P>The constant in the Java programming language, sometimes referred |
| 52 | * to as a type code, that identifies the generic SQL type |
| 53 | * <code>SMALLINT</code>. |
| 54 | */ |
| 55 | public final static int SMALLINT = 5; |
| 56 | |
| 57 | /** |
| 58 | * <P>The constant in the Java programming language, sometimes referred |
| 59 | * to as a type code, that identifies the generic SQL type |
| 60 | * <code>INTEGER</code>. |
| 61 | */ |
| 62 | public final static int INTEGER = 4; |
| 63 | |
| 64 | /** |
| 65 | * <P>The constant in the Java programming language, sometimes referred |
| 66 | * to as a type code, that identifies the generic SQL type |
| 67 | * <code>BIGINT</code>. |
| 68 | */ |
| 69 | public final static int BIGINT = -5; |
| 70 | |
| 71 | /** |
| 72 | * <P>The constant in the Java programming language, sometimes referred |
| 73 | * to as a type code, that identifies the generic SQL type |
| 74 | * <code>FLOAT</code>. |
| 75 | */ |
| 76 | public final static int FLOAT = 6; |
| 77 | |
| 78 | /** |
| 79 | * <P>The constant in the Java programming language, sometimes referred |
| 80 | * to as a type code, that identifies the generic SQL type |
| 81 | * <code>REAL</code>. |
| 82 | */ |
| 83 | public final static int REAL = 7; |
| 84 | |
| 85 | |
| 86 | /** |
| 87 | * <P>The constant in the Java programming language, sometimes referred |
| 88 | * to as a type code, that identifies the generic SQL type |
| 89 | * <code>DOUBLE</code>. |
| 90 | */ |
| 91 | public final static int DOUBLE = 8; |
| 92 | |
| 93 | /** |
| 94 | * <P>The constant in the Java programming language, sometimes referred |
| 95 | * to as a type code, that identifies the generic SQL type |
| 96 | * <code>NUMERIC</code>. |
| 97 | */ |
| 98 | public final static int NUMERIC = 2; |
| 99 | |
| 100 | /** |
| 101 | * <P>The constant in the Java programming language, sometimes referred |
| 102 | * to as a type code, that identifies the generic SQL type |
| 103 | * <code>DECIMAL</code>. |
| 104 | */ |
| 105 | public final static int DECIMAL = 3; |
| 106 | |
| 107 | /** |
| 108 | * <P>The constant in the Java programming language, sometimes referred |
| 109 | * to as a type code, that identifies the generic SQL type |
| 110 | * <code>CHAR</code>. |
| 111 | */ |
| 112 | public final static int CHAR = 1; |
| 113 | |
| 114 | /** |
| 115 | * <P>The constant in the Java programming language, sometimes referred |
| 116 | * to as a type code, that identifies the generic SQL type |
| 117 | * <code>VARCHAR</code>. |
| 118 | */ |
| 119 | public final static int VARCHAR = 12; |
| 120 | |
| 121 | /** |
| 122 | * <P>The constant in the Java programming language, sometimes referred |
| 123 | * to as a type code, that identifies the generic SQL type |
| 124 | * <code>LONGVARCHAR</code>. |
| 125 | */ |
| 126 | public final static int LONGVARCHAR = -1; |
| 127 | |
| 128 | |
| 129 | /** |
| 130 | * <P>The constant in the Java programming language, sometimes referred |
| 131 | * to as a type code, that identifies the generic SQL type |
| 132 | * <code>DATE</code>. |
| 133 | */ |
| 134 | public final static int DATE = 91; |
| 135 | |
| 136 | /** |
| 137 | * <P>The constant in the Java programming language, sometimes referred |
| 138 | * to as a type code, that identifies the generic SQL type |
| 139 | * <code>TIME</code>. |
| 140 | */ |
| 141 | public final static int TIME = 92; |
| 142 | |
| 143 | /** |
| 144 | * <P>The constant in the Java programming language, sometimes referred |
| 145 | * to as a type code, that identifies the generic SQL type |
| 146 | * <code>TIMESTAMP</code>. |
| 147 | */ |
| 148 | public final static int TIMESTAMP = 93; |
| 149 | |
| 150 | |
| 151 | /** |
| 152 | * <P>The constant in the Java programming language, sometimes referred |
| 153 | * to as a type code, that identifies the generic SQL type |
| 154 | * <code>BINARY</code>. |
| 155 | */ |
| 156 | public final static int BINARY = -2; |
| 157 | |
| 158 | /** |
| 159 | * <P>The constant in the Java programming language, sometimes referred |
| 160 | * to as a type code, that identifies the generic SQL type |
| 161 | * <code>VARBINARY</code>. |
| 162 | */ |
| 163 | public final static int VARBINARY = -3; |
| 164 | |
| 165 | /** |
| 166 | * <P>The constant in the Java programming language, sometimes referred |
| 167 | * to as a type code, that identifies the generic SQL type |
| 168 | * <code>LONGVARBINARY</code>. |
| 169 | */ |
| 170 | public final static int LONGVARBINARY = -4; |
| 171 | |
| 172 | /** |
| 173 | * <P>The constant in the Java programming language |
| 174 | * that identifies the generic SQL value |
| 175 | * <code>NULL</code>. |
| 176 | */ |
| 177 | public final static int NULL = 0; |
| 178 | |
| 179 | /** |
| 180 | * The constant in the Java programming language that indicates |
| 181 | * that the SQL type is database-specific and |
| 182 | * gets mapped to a Java object that can be accessed via |
| 183 | * the methods <code>getObject</code> and <code>setObject</code>. |
| 184 | */ |
| 185 | public final static int OTHER = 1111; |
| 186 | |
| 187 | |
| 188 | |
| 189 | /** |
| 190 | * The constant in the Java programming language, sometimes referred to |
| 191 | * as a type code, that identifies the generic SQL type |
| 192 | * <code>JAVA_OBJECT</code>. |
| 193 | * @since 1.2 |
| 194 | */ |
| 195 | public final static int JAVA_OBJECT = 2000; |
| 196 | |
| 197 | /** |
| 198 | * The constant in the Java programming language, sometimes referred to |
| 199 | * as a type code, that identifies the generic SQL type |
| 200 | * <code>DISTINCT</code>. |
| 201 | * @since 1.2 |
| 202 | */ |
| 203 | public final static int DISTINCT = 2001; |
| 204 | |
| 205 | /** |
| 206 | * The constant in the Java programming language, sometimes referred to |
| 207 | * as a type code, that identifies the generic SQL type |
| 208 | * <code>STRUCT</code>. |
| 209 | * @since 1.2 |
| 210 | */ |
| 211 | public final static int STRUCT = 2002; |
| 212 | |
| 213 | /** |
| 214 | * The constant in the Java programming language, sometimes referred to |
| 215 | * as a type code, that identifies the generic SQL type |
| 216 | * <code>ARRAY</code>. |
| 217 | * @since 1.2 |
| 218 | */ |
| 219 | public final static int ARRAY = 2003; |
| 220 | |
| 221 | /** |
| 222 | * The constant in the Java programming language, sometimes referred to |
| 223 | * as a type code, that identifies the generic SQL type |
| 224 | * <code>BLOB</code>. |
| 225 | * @since 1.2 |
| 226 | */ |
| 227 | public final static int BLOB = 2004; |
| 228 | |
| 229 | /** |
| 230 | * The constant in the Java programming language, sometimes referred to |
| 231 | * as a type code, that identifies the generic SQL type |
| 232 | * <code>CLOB</code>. |
| 233 | * @since 1.2 |
| 234 | */ |
| 235 | public final static int CLOB = 2005; |
| 236 | |
| 237 | /** |
| 238 | * The constant in the Java programming language, sometimes referred to |
| 239 | * as a type code, that identifies the generic SQL type |
| 240 | * <code>REF</code>. |
| 241 | * @since 1.2 |
| 242 | */ |
| 243 | public final static int REF = 2006; |
| 244 | |
| 245 | /** |
| 246 | * The constant in the Java programming language, somtimes referred to |
| 247 | * as a type code, that identifies the generic SQL type <code>DATALINK</code>. |
| 248 | * |
| 249 | * @since 1.4 |
| 250 | */ |
| 251 | public final static int DATALINK = 70; |
| 252 | |
| 253 | /** |
| 254 | * The constant in the Java programming language, somtimes referred to |
| 255 | * as a type code, that identifies the generic SQL type <code>BOOLEAN</code>. |
| 256 | * |
| 257 | * @since 1.4 |
| 258 | */ |
| 259 | public final static int BOOLEAN = 16; |
| 260 | |
| 261 | //------------------------- JDBC 4.0 ----------------------------------- |
| 262 | |
| 263 | /** |
| 264 | * The constant in the Java programming language, sometimes referred to |
| 265 | * as a type code, that identifies the generic SQL type <code>ROWID</code> |
| 266 | * |
| 267 | * @since 1.6 |
| 268 | * |
| 269 | */ |
| 270 | public final static int ROWID = -8; |
| 271 | |
| 272 | /** |
| 273 | * The constant in the Java programming language, sometimes referred to |
| 274 | * as a type code, that identifies the generic SQL type <code>NCHAR</code> |
| 275 | * |
| 276 | * @since 1.6 |
| 277 | */ |
| 278 | public static final int NCHAR = -15; |
| 279 | |
| 280 | /** |
| 281 | * The constant in the Java programming language, sometimes referred to |
| 282 | * as a type code, that identifies the generic SQL type <code>NVARCHAR</code>. |
| 283 | * |
| 284 | * @since 1.6 |
| 285 | */ |
| 286 | public static final int NVARCHAR = -9; |
| 287 | |
| 288 | /** |
| 289 | * The constant in the Java programming language, sometimes referred to |
| 290 | * as a type code, that identifies the generic SQL type <code>LONGNVARCHAR</code>. |
| 291 | * |
| 292 | * @since 1.6 |
| 293 | */ |
| 294 | public static final int LONGNVARCHAR = -16; |
| 295 | |
| 296 | /** |
| 297 | * The constant in the Java programming language, sometimes referred to |
| 298 | * as a type code, that identifies the generic SQL type <code>NCLOB</code>. |
| 299 | * |
| 300 | * @since 1.6 |
| 301 | */ |
| 302 | public static final int NCLOB = 2011; |
| 303 | |
| 304 | /** |
| 305 | * The constant in the Java programming language, sometimes referred to |
| 306 | * as a type code, that identifies the generic SQL type <code>XML</code>. |
| 307 | * |
| 308 | * @since 1.6 |
| 309 | */ |
| 310 | public static final int SQLXML = 2009; |
| 311 | |
| 312 | // Prevent instantiation |
| 313 | private Types() {} |
| 314 | } |