Java SQL Type getSQLTypeName(int sqlType)

Here you can find the source of getSQLTypeName(int sqlType)

Description

get SQL Type Name

License

Open Source License

Declaration

public static String getSQLTypeName(int sqlType) 

Method Source Code

//package com.java2s;

public class Main {
    public static String getSQLTypeName(int sqlType) {
        String resultType = null;
        switch (sqlType) {
        case java.sql.Types.BIT: {
            resultType = "BIT";
        }/*from ww  w. j  a v  a  2s  . co m*/
        case java.sql.Types.BIGINT: {
            resultType = "BIGINT";
            break;
        }
        case java.sql.Types.CHAR: {
            resultType = "CHAR";
            break;
        }
        case java.sql.Types.INTEGER: {
            resultType = "INTEGER";
            break;
        }
        case java.sql.Types.SMALLINT: {
            resultType = "SMALLINT";
            break;
        }
        case java.sql.Types.VARCHAR: {
            resultType = "VARCHAR";
            break;
        }
        case java.sql.Types.REAL: {
            resultType = "REAL";
            break;
        }
        case java.sql.Types.DOUBLE: {
            resultType = "DOUBLE";
            break;
        }
        case java.sql.Types.DATE: {
            resultType = "DATE";
            break;
        }
        case java.sql.Types.TIME: {
            resultType = "TIME";
            break;
        }
        case java.sql.Types.TIMESTAMP: {
            resultType = "TIMESTAMP";
            break;
        }
        case java.sql.Types.BLOB: {
            resultType = "BLOB";
            break;
        }
        case java.sql.Types.TINYINT: {
            resultType = "TINYINT";
            break;
        }
        case java.sql.Types.FLOAT: {
            resultType = "FLOAT";
            break;
        }
        case java.sql.Types.NUMERIC: {
            resultType = "NUMERIC";
            break;
        }
        case java.sql.Types.DECIMAL: {
            resultType = "DECIMAL";
            break;
        }
        case java.sql.Types.LONGVARCHAR: {
            resultType = "LONGVARCHAR";
            break;
        }
        case java.sql.Types.BINARY: {
            resultType = "BINARY";
            break;
        }
        case java.sql.Types.VARBINARY: {
            resultType = "VARBINARY";
            break;
        }
        case java.sql.Types.LONGVARBINARY: {
            resultType = "LONGVARBINARY";
            break;
        }
        case java.sql.Types.NULL: {
            resultType = "NULL";
            break;
        }
        case java.sql.Types.OTHER: {
            resultType = "OTHER";
            break;
        }
        case java.sql.Types.JAVA_OBJECT: {
            resultType = "JAVA_OBJECT";
            break;
        }
        case java.sql.Types.DISTINCT: {
            resultType = "DISTINCT";
            break;
        }
        case java.sql.Types.STRUCT: {
            resultType = "STRUCT";
            break;
        }
        case java.sql.Types.ARRAY: {
            resultType = "ARRAY";
            break;
        }
        case java.sql.Types.CLOB: {
            resultType = "CLOB";
            break;
        }
        case java.sql.Types.REF: {
            resultType = "REF";
            break;
        }
        case java.sql.Types.DATALINK: {
            resultType = "DATALINK";
            break;
        }
        case java.sql.Types.BOOLEAN: {
            resultType = "BOOLEAN";
            break;
        }
        case java.sql.Types.ROWID: {
            resultType = "ROWID";
            break;
        }
        case java.sql.Types.NCHAR: {
            resultType = "NCHAR";
            break;
        }
        case java.sql.Types.NVARCHAR: {
            resultType = "NVARCHAR";
            break;
        }
        case java.sql.Types.LONGNVARCHAR: {
            resultType = "LONGNVARCHAR";
            break;
        }
        case java.sql.Types.NCLOB: {
            resultType = "NCLOB";
            break;
        }
        case java.sql.Types.SQLXML: {
            resultType = "SQLXML";
            break;
        }
        default:
            resultType = null;
        }
        return resultType;
    }
}

Related

  1. getSQLType(String text)
  2. getSQLType(String type)
  3. getSqlTypeAsString(int jdbcType)
  4. getSQLTypeByName(String type)
  5. getSqlTypeByValue(Object value)
  6. getSQLTypeName(int sqlType)
  7. getSqlTypeName(int sqlType)
  8. getSqlTypeName(int type)
  9. getSQLTypeName(Integer sqltypecode)