Java SQL Type getJavaType(int jdbcType)

Here you can find the source of getJavaType(int jdbcType)

Description

get Java Type

License

Apache License

Declaration

public static String getJavaType(int jdbcType) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;

import java.util.Date;

public class Main {
    public static String getJavaType(int jdbcType) {
        switch (jdbcType) {
        case Types.BIT:
            return Boolean.class.getName();
        case Types.TINYINT:
            return Byte.class.getName();
        case Types.SMALLINT:
            return Short.class.getName();
        case Types.CHAR:
            return String.class.getName();
        case Types.VARCHAR:
            return String.class.getName();
        case Types.DATE:
            return Date.class.getName();
        case Types.TIME:
            return Time.class.getName();
        case Types.TIMESTAMP:
            return Timestamp.class.getName();
        case Types.DOUBLE:
            return Double.class.getName();
        case Types.FLOAT:
            return Float.class.getName();
        case Types.INTEGER:
            return Integer.class.getName();
        case Types.BIGINT:
            return BigInteger.class.getName();
        case Types.NUMERIC:
            return BigDecimal.class.getName();
        case Types.DECIMAL:
            return BigDecimal.class.getName();
        case Types.BINARY:
            return byte[].class.getName();
        case Types.VARBINARY:
            return byte[].class.getName();
        case Types.OTHER:
            return Object.class.getName();
        default://from  w w  w.  jav  a  2 s . com
            return String.class.getName();
        }
    }
}

Related

  1. getFormatTypeAsString(int fieldType)
  2. getInsertarEmpresa()
  3. getIntTypeString(Connection conn)
  4. getIntValue(String typeName)
  5. getJavaType(int dataType, int columnSize, int decimalDegit)
  6. getJavaType(int sqlType)
  7. getJavaType(String rdbType)
  8. getJavaTypeFromSqlType(int sqlType)
  9. getJavaTypeNameByJdbcType(int jdbcType)