Java SQL Type typeToString(int sqlType)

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

Description

type To String

License

Open Source License

Declaration

private static String typeToString(int sqlType) 

Method Source Code

//package com.java2s;
/*//from w  w w  . ja va2 s .c  o  m
 * Copyright (c) Mirth Corporation. All rights reserved.
 * 
 * http://www.mirthcorp.com
 * 
 * The software in this package is published under the terms of the MPL license a copy of which has
 * been included with this distribution in the LICENSE.txt file.
 */

import java.sql.Types;

public class Main {
    private static String typeToString(int sqlType) {
        switch (sqlType) {
        case Types.ARRAY:
            return "ARRAY";
        case Types.BIGINT:
            return "BIGINT";
        case Types.BINARY:
            return "BINARY";
        case Types.BIT:
            return "BIT";
        case Types.BLOB:
            return "BLOB";
        case Types.BOOLEAN:
            return "BOOLEAN";
        case Types.CHAR:
            return "CHAR";
        case Types.CLOB:
            return "CLOB";
        case Types.DATALINK:
            return "DATALINK";
        case Types.DATE:
            return "DATE";
        case Types.DECIMAL:
            return "DECIMAL";
        case Types.DISTINCT:
            return "DISTINCT";
        case Types.DOUBLE:
            return "DOUBLE";
        case Types.FLOAT:
            return "FLOAT";
        case Types.INTEGER:
            return "INTEGER";
        case Types.JAVA_OBJECT:
            return "JAVA_OBJECT";
        case Types.LONGNVARCHAR:
            return "LONGNVARCHAR";
        case Types.LONGVARBINARY:
            return "LONGVARBINARY";
        case Types.LONGVARCHAR:
            return "LONGVARCHAR";
        case Types.NCHAR:
            return "NCHAR";
        case Types.NCLOB:
            return "NCLOB";
        case Types.NULL:
            return "NULL";
        case Types.NUMERIC:
            return "NUMERIC";
        case Types.NVARCHAR:
            return "NVARCHAR";
        case Types.OTHER:
            return "OTHER";
        case Types.REAL:
            return "REAL";
        case Types.REF:
            return "REF";
        case Types.ROWID:
            return "ROWID";
        case Types.SMALLINT:
            return "SMALLINT";
        case Types.SQLXML:
            return "SQLXML";
        case Types.STRUCT:
            return "STRUCT";
        case Types.TIME:
            return "TIME";
        case Types.TIMESTAMP:
            return "TIMESTAMP";
        case Types.TINYINT:
            return "TINYINT";
        case Types.VARBINARY:
            return "VARBINARY";
        case Types.VARCHAR:
            return "VARCHAR";
        default:
            return "UNKNOWN";
        }
    }
}

Related

  1. toSqlType(String clickshouseType)
  2. translateType(int sqlType)
  3. typeName(int type)
  4. typeNameToValueType(String typeName)
  5. typeToClass(int type)
  6. writeObject(Object obj, int sqlType, DataOutput out)