1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package java.sql; 19 20 /** 21 * A class which defines constants used to identify generic SQL types, also 22 * called JDBC types. The type constant values are equivalent to those defined 23 * by X/OPEN. 24 */ 25 public class Types { 26 27 /* 28 * Private constructor to prevent instantiation. 29 */ Types()30 private Types() { 31 } 32 33 /** 34 * The type code that identifies the SQL type {@code ARRAY}. 35 */ 36 public static final int ARRAY = 2003; 37 38 /** 39 * The type code that identifies the SQL type {@code BIGINT}. 40 */ 41 public static final int BIGINT = -5; 42 43 /** 44 * The type code that identifies the SQL type {@code BINARY}. 45 */ 46 public static final int BINARY = -2; 47 48 /** 49 * The type code that identifies the SQL type {@code BIT}. 50 */ 51 public static final int BIT = -7; 52 53 /** 54 * The type code that identifies the SQL type {@code BLOB}. 55 */ 56 public static final int BLOB = 2004; 57 58 /** 59 * The type code that identifies the SQL type {@code BOOLEAN}. 60 */ 61 public static final int BOOLEAN = 16; 62 63 /** 64 * The type code that identifies the SQL type {@code CHAR}. 65 */ 66 public static final int CHAR = 1; 67 68 /** 69 * The type code that identifies the SQL type {@code CLOB}. 70 */ 71 public static final int CLOB = 2005; 72 73 /** 74 * The type code that identifies the SQL type {@code DATALINK}. 75 */ 76 public static final int DATALINK = 70; 77 78 /** 79 * The type code that identifies the SQL type {@code DATE}. 80 */ 81 public static final int DATE = 91; 82 83 /** 84 * The type code that identifies the SQL type {@code DECIMAL}. 85 */ 86 public static final int DECIMAL = 3; 87 88 /** 89 * The type code that identifies the SQL type {@code DISTINCT}. 90 */ 91 public static final int DISTINCT = 2001; 92 93 /** 94 * The type code that identifies the SQL type {@code DOUBLE}. 95 */ 96 public static final int DOUBLE = 8; 97 98 /** 99 * The type code that identifies the SQL type {@code FLOAT}. 100 */ 101 public static final int FLOAT = 6; 102 103 /** 104 * The type code that identifies the SQL type {@code INTEGER}. 105 */ 106 public static final int INTEGER = 4; 107 108 /** 109 * The type code that identifies the SQL type {@code JAVA_OBJECT}. 110 */ 111 public static final int JAVA_OBJECT = 2000; 112 113 /** 114 * The type code that identifies the SQL type {@code LONGVARBINARY}. 115 */ 116 public static final int LONGVARBINARY = -4; 117 118 /** 119 * The type code that identifies the SQL type {@code LONGVARCHAR}. 120 */ 121 public static final int LONGVARCHAR = -1; 122 123 /** 124 * The type code that identifies the SQL type {@code NULL}. 125 */ 126 public static final int NULL = 0; 127 128 /** 129 * The type code that identifies the SQL type {@code NUMERIC}. 130 */ 131 public static final int NUMERIC = 2; 132 133 /** 134 * The type code that identifies that the SQL type is database specific and 135 * is mapped to a Java object, accessed via the methods 136 * {@code getObject} and {@code setObject}. 137 */ 138 public static final int OTHER = 1111; 139 140 /** 141 * The type code that identifies the SQL type {@code REAL}. 142 */ 143 public static final int REAL = 7; 144 145 /** 146 * The type code that identifies the SQL type {@code REF}. 147 */ 148 public static final int REF = 2006; 149 150 /** 151 * The type code that identifies the SQL type {@code SMALLINT}. 152 */ 153 public static final int SMALLINT = 5; 154 155 /** 156 * The type code that identifies the SQL type {@code STRUCT}. 157 */ 158 public static final int STRUCT = 2002; 159 160 /** 161 * The type code that identifies the SQL type {@code TIME}. 162 */ 163 public static final int TIME = 92; 164 165 /** 166 * The type code that identifies the SQL type {@code TIMESTAMP}. 167 */ 168 public static final int TIMESTAMP = 93; 169 170 /** 171 * The type code that identifies the SQL type {@code TINYINT}. 172 */ 173 public static final int TINYINT = -6; 174 175 /** 176 * The type code that identifies the SQL type {@code VARBINARY}. 177 */ 178 public static final int VARBINARY = -3; 179 180 /** 181 * The type code that identifies the SQL type {@code VARCHAR}. 182 */ 183 public static final int VARCHAR = 12; 184 185 /** 186 * The type code that identifies the SQL type ROWID. 187 */ 188 public static final int ROWID = -8; 189 190 /** 191 * The type code that identifies the SQL type NCHAR. 192 */ 193 public static final int NCHAR = -15; 194 195 /** 196 * The type code that identifies the SQL type NVARCHAR. 197 */ 198 public static final int NVARCHAR = -9; 199 200 /** 201 * The type code that identifies the SQL type LONGNVARCHAR. 202 */ 203 public static final int LONGNVARCHAR = -16; 204 205 /** 206 * The type code that identifies the SQL type NCLOB. 207 */ 208 public static final int NCLOB = 2011; 209 210 /** 211 * The type code that identifies the SQL type SQLXML. 212 */ 213 public static final int SQLXML = 2009; 214 } 215