001 /* 002 * JBoss DNA (http://www.jboss.org/dna) 003 * See the COPYRIGHT.txt file distributed with this work for information 004 * regarding copyright ownership. Some portions may be licensed 005 * to Red Hat, Inc. under one or more contributor license agreements. 006 * See the AUTHORS.txt file in the distribution for a full listing of 007 * individual contributors. 008 * 009 * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA 010 * is licensed to you under the terms of the GNU Lesser General Public License as 011 * published by the Free Software Foundation; either version 2.1 of 012 * the License, or (at your option) any later version. 013 * 014 * JBoss DNA is distributed in the hope that it will be useful, 015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 017 * Lesser General Public License for more details. 018 * 019 * You should have received a copy of the GNU Lesser General Public 020 * License along with this software; if not, write to the Free 021 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 022 * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 023 */ 024 package org.jboss.dna.common.jdbc.model.api; 025 026 import java.sql.Types; 027 028 /** 029 * Provides RDBMS supported standard SQL types as enumeration set. 030 * 031 * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a> 032 */ 033 public enum SqlType { 034 035 BIT(Types.BIT), 036 TINYINT(Types.TINYINT), 037 SMALLINT(Types.SMALLINT), 038 INTEGER(Types.INTEGER), 039 BIGINT(Types.BIGINT), 040 FLOAT(Types.FLOAT), 041 REAL(Types.REAL), 042 DOUBLE(Types.DOUBLE), 043 NUMERIC(Types.NUMERIC), 044 DECIMAL(Types.DECIMAL), 045 CHAR(Types.CHAR), 046 VARCHAR(Types.VARCHAR), 047 LONGVARCHAR(Types.LONGVARCHAR), 048 DATE(Types.DATE), 049 TIME(Types.TIME), 050 TIMESTAMP(Types.TIMESTAMP), 051 BINARY(Types.BINARY), 052 VARBINARY(Types.VARBINARY), 053 LONGVARBINARY(Types.LONGVARBINARY), 054 NULL(Types.NULL), 055 OTHER(Types.OTHER), 056 JAVA_OBJECT(Types.JAVA_OBJECT), 057 DISTINCT(Types.DISTINCT), 058 STRUCT(Types.STRUCT), 059 ARRAY(Types.ARRAY), 060 BLOB(Types.BLOB), 061 CLOB(Types.CLOB), 062 REF(Types.REF), 063 DATALINK(Types.DATALINK), 064 BOOLEAN(Types.BOOLEAN); 065 066 private final int type; 067 068 SqlType( int type ) { 069 this.type = type; 070 } 071 072 public int getType() { 073 return type; 074 } 075 076 public String getName() { 077 return name(); 078 } 079 }