Here you can find the source of translateType(int sqlType)
Parameter | Description |
---|---|
sqlType | the type to be translated into a simpler type |
public static int translateType(int sqlType)
//package com.java2s; //License from project: Apache License import java.sql.Types; public class Main { /**/*from www. j a v a2 s . co m*/ * Translate a SQL type into one of a few values. * All integer types are translated to Integer. * All real types are translated to Double. * All string types are translated to String. * All other types are left untouched. * @param sqlType the type to be translated into a simpler type * @return the new SQL type */ public static int translateType(int sqlType) { int retType = sqlType; if (Types.BIT == sqlType || Types.TINYINT == sqlType || Types.SMALLINT == sqlType || Types.INTEGER == sqlType) retType = Types.INTEGER; else if (Types.CHAR == sqlType || Types.VARCHAR == sqlType) retType = Types.VARCHAR; else if (Types.DECIMAL == sqlType || Types.DOUBLE == sqlType || Types.FLOAT == sqlType || Types.NUMERIC == sqlType || Types.REAL == sqlType) retType = Types.NUMERIC; return retType; } }