Java SQL Type getType(int csqltype)

Here you can find the source of getType(int csqltype)

Description

get Type

License

Open Source License

Declaration

public static int getType(int csqltype) 

Method Source Code


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

import java.sql.Types;

public class Main {
    public static int getType(int csqltype) {
        switch (csqltype) {
        case 0:/*from w  ww  .  ja va2s.c  o  m*/
            return Types.INTEGER;
        case 1:
            return Types.BIGINT;
        case 2:
            return Types.BIGINT;
        case 3:
            return Types.SMALLINT;
        case 4:
            return Types.TINYINT;

        case 10:
            return Types.DOUBLE;
        case 11:
            return Types.FLOAT;
        case 12:
            return Types.DECIMAL;

        case 20:
            return Types.DATE;
        case 21:
            return Types.TIME;
        case 22:
            return Types.TIMESTAMP;

        case 30:
            return Types.CHAR;
        case 31:
            return Types.BINARY;

        case 100:

        default:
            return Types.OTHER;
        }
    }
}

Related

  1. getSQLTypeRadix(int sqlType)
  2. getSqlValue(Object o)
  3. getStringFormat(int colType)
  4. getTableTypes(DatabaseMetaData dbmd)
  5. getTinyIntTypeString(Connection conn)
  6. getTypeforValue(int type)
  7. getTypeName(int dataType)
  8. getTypeName(int typeNumber)
  9. getTypeNameForJDBCType(int jdbcType)