Java SQL Type sqlTypeToSetterGetter(int sqlType)

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

Description

sql Type To Setter Getter

License

Open Source License

Declaration

public static String sqlTypeToSetterGetter(int sqlType) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Types;

public class Main {
    public static String sqlTypeToSetterGetter(int sqlType) {
        switch (sqlType) {
        case Types.BIT:
            return "Boolean";
        case Types.TINYINT:
            return "Boolean";
        case Types.SMALLINT:
            return "Short";
        case Types.INTEGER:
            return "Int";
        case Types.BIGINT:
            return "Long";
        case Types.REAL:
            return "Float";
        case Types.DOUBLE:
            return "Double";
        case Types.FLOAT:
            return "Float";
        case Types.NUMERIC:
        case Types.DECIMAL:
            return "BigDecimal";
        case Types.DATE:
            return "Date";
        case Types.TIME:
            return "Time";
        case Types.TIMESTAMP:
            return "Timestamp";
        case Types.CHAR:
        case Types.VARCHAR:
        case Types.LONGVARCHAR:
            return "String";
        case Types.BINARY:
        case Types.VARBINARY:
        case Types.LONGVARBINARY:
            return "BinaryStream";
        default://  ww  w.  java2 s . com
            return null;
        }
    }
}

Related

  1. sqlTypeName(final int value)
  2. sqlTypeString(int sqlType)
  3. sqlTypeToClass(int sqlType, String className)
  4. sqlTypeToClassType(final Integer sqlType)
  5. sqlTypeToHiveType(Integer type)
  6. sqlTypeToSqlTypeName(final int type)
  7. toClass(final int type)
  8. toClass(int sqlType, boolean isUnsigned)
  9. toHCatType(int sqlType)