Java SQL Type getJdbcType(String datatype)

Here you can find the source of getJdbcType(String datatype)

Description

get Jdbc Type

License

Open Source License

Declaration

public static int getJdbcType(String datatype) 

Method Source Code

//package com.java2s;

import java.sql.Types;

public class Main {
    public static int getJdbcType(String datatype) {
        int jdbcType = 0;
        if ("BLOB".equals(datatype)) {
            jdbcType = Types.BLOB;
        } else if ("CHAR".equals(datatype)) {
            jdbcType = Types.CHAR;
        } else if ("CLOB".equals(datatype)) {
            jdbcType = Types.CLOB;
        } else if ("DATE".equals(datatype)) {
            jdbcType = Types.DATE;
        } else if ("FLOAT".equals(datatype)) {
            jdbcType = Types.FLOAT;
        } else if ("LONG".equals(datatype)) {
            jdbcType = Types.LONGVARCHAR;
        } else if ("NUMBER".equals(datatype)) {
            jdbcType = Types.NUMERIC;
        } else if ("TIMESTAMP".equals(datatype)) {
            jdbcType = Types.TIMESTAMP;
        } else if ("VARCHAR2".equals(datatype)) {
            jdbcType = Types.VARCHAR;
        }/*from   w  w w  . j  a  v  a 2  s. co m*/
        return jdbcType;
    }
}

Related

  1. getJavaType(int sqlType)
  2. getJavaType(String rdbType)
  3. getJavaTypeFromSqlType(int sqlType)
  4. getJavaTypeNameByJdbcType(int jdbcType)
  5. getJdbcType(int firebirdType)
  6. getJdbcType(String typeName)
  7. getJdbcTypeClass(int type)
  8. getJDBCTypeForNamedType(String aTypeName)
  9. getJdbcTypeName(int jdbcType)