Java SQL Type sqlType2Name(int sqlType)

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

Description

sql Type Name

License

Apache License

Declaration

public static final String sqlType2Name(int sqlType) 

Method Source Code

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

public class Main {
    public static final String sqlType2Name(int sqlType) {
        try {//from   w w w  .  j a  v a 2 s.c o m
            Class cls = java.sql.Types.class; // Class.forName("java.sql.Types"); // SecurityException
            java.lang.reflect.Field[] fields = cls.getFields();
            for (int i = 0; i < fields.length; i++) {
                if (fields[i].getInt(null) == sqlType)
                    return fields[i].getName();
            }
        } catch (Throwable ex) {
        }
        return null;
    }
}

Related

  1. readMapListBySQL(String fileDir, String sql, List headers, List headerTypes)
  2. readObject(DataInput in, int sqlType)
  3. resolveEscapes(String escaped, boolean noBackslashEscapes)
  4. setFieldValue(Object oBean, String sFieldName, Object oValue)
  5. setProperty(Object object, String name, String value)
  6. sqlType4Object(Object obj)
  7. sqlTypeFromString(String sqlType)
  8. sqlTypeIsNumeric(int sqlType)
  9. sqlTypeName(final int value)