Here you can find the source of getSQLType(String text)
Parameter | Description |
---|---|
text | a parameter |
public static Integer getSQLType(String text)
//package com.java2s; public class Main { private static String types = "java.sql.Types."; /**//from w w w .jav a2 s. co m * Returns the SQL TYPE for a string for example if text is "VARCHAR" * java.sql.Types.VARCHAR is returned * * @param text * @return a static constant of java.sql.Types or NULL if this constant does * not exist */ public static Integer getSQLType(String text) { // if full path is given: reduce to type name if (text.contains(".") && text.substring(0, types.length()).equalsIgnoreCase(types)) { text = text.substring(types.length(), text.length()); } // check needed for case: path was not "java.sql.types" if (!text.contains(".")) { try { java.lang.reflect.Field f = java.sql.Types.class.getField(text); return f.getInt(f); } catch (IllegalArgumentException e) { // only return null; } catch (IllegalAccessException e) { // only return null; } catch (SecurityException e) { // only return null; } catch (NoSuchFieldException e) { // only return null; } } return null; } }