Java SQL Type isNativeType(final Class type)

Here you can find the source of isNativeType(final Class type)

Description

Returns true if the provided class is a type supported natively (as opposed to a bean).

License

Open Source License

Parameter

Parameter Description
type java.lang.Class type to be tested

Declaration

public static boolean isNativeType(final Class type) 

Method Source Code

//package com.java2s;

import java.math.BigDecimal;

public class Main {
    /**//from  w ww  . jav  a 2s  .  c  om
     * Returns true if the provided class is a type supported natively (as
     * opposed to a bean).
     * 
     * @param type {@link java.lang.Class} type to be tested
     */
    public static boolean isNativeType(final Class type) {

        // to return an arbitrary object use Object.class
        return (type == boolean.class || type == Boolean.class || type == byte.class || type == Byte.class
                || type == short.class || type == Short.class || type == int.class || type == Integer.class
                || type == long.class || type == Long.class || type == float.class || type == Float.class
                || type == double.class || type == Double.class || type == char.class || type == Character.class
                || type == byte[].class || type == Byte[].class || type == char[].class || type == Character[].class
                || type == String.class || type == BigDecimal.class || type == java.util.Date.class
                || type == java.sql.Date.class || type == java.sql.Time.class || type == java.sql.Timestamp.class
                || type == java.io.InputStream.class || type == java.io.Reader.class || type == java.sql.Clob.class
                || type == java.sql.Blob.class || type == Object.class);
    }
}

Related

  1. isClobType(int sqlType)
  2. isDataNeedsQuotes(int type)
  3. isDigitalType(int sqlType)
  4. isJDBCType(final int type)
  5. isLobColumn(int dataType)
  6. isNumberic(int type)
  7. isNumberType(int aSqlType)
  8. isNumberType(int sqlType)
  9. isNumeric(int dataType)