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

static String getSQLTypeName(int sqlType) 

Method Source Code

//package com.java2s;
/*//from   w  w  w. j ava  2 s  . co m
 * The contents of this file are subject to the Interbase Public
 * License Version 1.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy
 * of the License at http://www.Inprise.com/IPL.html
 *
 * Software distributed under the License is distributed on an
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code was created by Inprise Corporation
 * and its predecessors. Portions created by Inprise Corporation are
 * Copyright (C) Inprise Corporation.
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */

public class Main {
    static String getSQLTypeName(int sqlType) {
        switch (sqlType) {
        case java.sql.Types.BIGINT:
            return "BIGINT";
        case java.sql.Types.BINARY:
            return "BINARY";
        case java.sql.Types.BIT:
            return "BIT";
        case java.sql.Types.CHAR:
            return "CHAR";
        case java.sql.Types.DATE:
            return "DATE";
        case java.sql.Types.DECIMAL:
            return "DECIMAL";
        case java.sql.Types.DOUBLE:
            return "DOUBLE";
        case java.sql.Types.FLOAT:
            return "FLOAT";
        case java.sql.Types.INTEGER:
            return "INTEGER";
        case java.sql.Types.LONGVARBINARY:
            return "LONGVARBINARY";
        case java.sql.Types.LONGVARCHAR:
            return "LONGVARCHAR";
        case java.sql.Types.NULL:
            return "NULL";
        case java.sql.Types.NUMERIC:
            return "NUMERIC";
        case java.sql.Types.OTHER:
            return "OTHER";
        case java.sql.Types.REAL:
            return "REAL";
        case java.sql.Types.SMALLINT:
            return "SMALLINT";
        case java.sql.Types.TIME:
            return "TIME";
        case java.sql.Types.TIMESTAMP:
            return "TIMESTAMP";
        case java.sql.Types.TINYINT:
            return "TINYINT";
        case java.sql.Types.VARBINARY:
            return "VARBINARY";
        case java.sql.Types.VARCHAR:
            return "VARCHAR";
        default:
            return null;
        }
    }
}

Related

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