Here you can find the source of getTypeName(int dataType)
Parameter | Description |
---|---|
dataType | The int datatype for which we need the string datatype name. |
public static String getTypeName(int dataType)
//package com.java2s; //License from project: Apache License import java.sql.Types; public class Main { /**//from w w w . j a va2 s. c o m * * Given an int datatype, return the java.sql.Types name for that datatype. * * @param dataType * The int datatype for which we need the string datatype name. * * @return A string representation of the datatype name. * */ public static String getTypeName(int dataType) { switch (dataType) { case Types.BIGINT: return "BIGINT"; case Types.BINARY: return "BINARY"; case Types.BIT: return "BIT"; case Types.CHAR: return "CHAR"; case Types.DATE: return "DATE"; case Types.DECIMAL: return "DECIMAL"; case Types.DOUBLE: return "DOUBLE"; case Types.FLOAT: return "FLOAT"; case Types.INTEGER: return "INTEGER"; case Types.LONGVARBINARY: return "LONGVARBINARY"; case Types.LONGVARCHAR: return "LONGVARCHAR"; case Types.NULL: return "NULL"; case Types.NUMERIC: return "NUMERIC"; case Types.OTHER: return "OTHER"; case Types.REAL: return "REAL"; case Types.SMALLINT: return "SMALLINT"; 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"; } return "UNKNOWN"; } }