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 super(); 32 } 33 34 /** 35 * The type code that identifies the SQL type {@code ARRAY}. 36 */ 37 public static final int ARRAY = 2003; 38 39 /** 40 * The type code that identifies the SQL type {@code BIGINT}. 41 */ 42 public static final int BIGINT = -5; 43 44 /** 45 * The type code that identifies the SQL type {@code BINARY}. 46 */ 47 public static final int BINARY = -2; 48 49 /** 50 * The type code that identifies the SQL type {@code BIT}. 51 */ 52 public static final int BIT = -7; 53 54 /** 55 * The type code that identifies the SQL type {@code BLOB}. 56 */ 57 public static final int BLOB = 2004; 58 59 /** 60 * The type code that identifies the SQL type {@code BOOLEAN}. 61 */ 62 public static final int BOOLEAN = 16; 63 64 /** 65 * The type code that identifies the SQL type {@code CHAR}. 66 */ 67 public static final int CHAR = 1; 68 69 /** 70 * The type code that identifies the SQL type {@code CLOB}. 71 */ 72 public static final int CLOB = 2005; 73 74 /** 75 * The type code that identifies the SQL type {@code DATALINK}. 76 */ 77 public static final int DATALINK = 70; 78 79 /** 80 * The type code that identifies the SQL type {@code DATE}. 81 */ 82 public static final int DATE = 91; 83 84 /** 85 * The type code that identifies the SQL type {@code DECIMAL}. 86 */ 87 public static final int DECIMAL = 3; 88 89 /** 90 * The type code that identifies the SQL type {@code DISTINCT}. 91 */ 92 public static final int DISTINCT = 2001; 93 94 /** 95 * The type code that identifies the SQL type {@code DOUBLE}. 96 */ 97 public static final int DOUBLE = 8; 98 99 /** 100 * The type code that identifies the SQL type {@code FLOAT}. 101 */ 102 public static final int FLOAT = 6; 103 104 /** 105 * The type code that identifies the SQL type {@code INTEGER}. 106 */ 107 public static final int INTEGER = 4; 108 109 /** 110 * The type code that identifies the SQL type {@code JAVA_OBJECT}. 111 */ 112 public static final int JAVA_OBJECT = 2000; 113 114 /** 115 * The type code that identifies the SQL type {@code LONGVARBINARY}. 116 */ 117 public static final int LONGVARBINARY = -4; 118 119 /** 120 * The type code that identifies the SQL type {@code LONGVARCHAR}. 121 */ 122 public static final int LONGVARCHAR = -1; 123 124 /** 125 * The type code that identifies the SQL type {@code NULL}. 126 */ 127 public static final int NULL = 0; 128 129 /** 130 * The type code that identifies the SQL type {@code NUMERIC}. 131 */ 132 public static final int NUMERIC = 2; 133 134 /** 135 * The type code that identifies that the SQL type is database specific and 136 * is mapped to a Java object, accessed via the methods 137 * {@code getObject} and {@code setObject}. 138 */ 139 public static final int OTHER = 1111; 140 141 /** 142 * The type code that identifies the SQL type {@code REAL}. 143 */ 144 public static final int REAL = 7; 145 146 /** 147 * The type code that identifies the SQL type {@code REF}. 148 */ 149 public static final int REF = 2006; 150 151 /** 152 * The type code that identifies the SQL type {@code SMALLINT}. 153 */ 154 public static final int SMALLINT = 5; 155 156 /** 157 * The type code that identifies the SQL type {@code STRUCT}. 158 */ 159 public static final int STRUCT = 2002; 160 161 /** 162 * The type code that identifies the SQL type {@code TIME}. 163 */ 164 public static final int TIME = 92; 165 166 /** 167 * The type code that identifies the SQL type {@code TIMESTAMP}. 168 */ 169 public static final int TIMESTAMP = 93; 170 171 /** 172 * The type code that identifies the SQL type {@code TINYINT}. 173 */ 174 public static final int TINYINT = -6; 175 176 /** 177 * The type code that identifies the SQL type {@code VARBINARY}. 178 */ 179 public static final int VARBINARY = -3; 180 181 /** 182 * The type code that identifies the SQL type {@code VARCHAR}. 183 */ 184 public static final int VARCHAR = 12; 185 186 /** 187 * The type code that identifies the SQL type ROWID. 188 */ 189 public static final int ROWID = -8; 190 191 /** 192 * The type code that identifies the SQL type NCHAR. 193 */ 194 public static final int NCHAR = -15; 195 196 /** 197 * The type code that identifies the SQL type NVARCHAR. 198 */ 199 public static final int NVARCHAR = -9; 200 201 /** 202 * The type code that identifies the SQL type LONGNVARCHAR. 203 */ 204 public static final int LONGNVARCHAR = -16; 205 206 /** 207 * The type code that identifies the SQL type NCLOB. 208 */ 209 public static final int NCLOB = 2011; 210 211 /** 212 * The type code that identifies the SQL type SQLXML. 213 */ 214 public static final int SQLXML = 2009; 215 } 216