Here you can find the source of getSqlType(String cubridType)
Parameter | Description |
---|---|
cubridType | a parameter |
public static int getSqlType(String cubridType)
//package com.java2s; import java.sql.Types; public class Main { /**/*from ww w .j a v a2 s. c o m*/ * get the java.sql type map to cubrid data type. * * @param cubridType * @return */ public static int getSqlType(String cubridType) { if (cubridType == null || cubridType.trim().equals("")) { return Types.VARCHAR; } cubridType = cubridType.toUpperCase(); if (cubridType.equals("CHAR")) { return Types.CHAR; } else if (cubridType.equals("VARCHAR")) { return Types.VARCHAR; } else if (cubridType.equals("STRING")) { return Types.VARCHAR; } else if (cubridType.equals("NCHAR")) { return Types.CHAR; } else if (cubridType.equals("BIT")) { return Types.BIT; } else if (cubridType.equals("BIT VARYING")) { return Types.BIT; } else if (cubridType.equals("NUMERIC") || cubridType.equals("DECIMAL")) { return Types.NUMERIC; } else if (cubridType.equals("INTEGER") || cubridType.equals("INT")) { return Types.INTEGER; } else if (cubridType.equals("SMALLINT")) { return Types.SMALLINT; } else if (cubridType.equals("MONETARY")) { return Types.VARCHAR; } else if (cubridType.equals("FLOAT") || cubridType.equals("REAL")) { return Types.FLOAT; } else if (cubridType.equals("DOUBLE PRECISION") || cubridType.equals("DOUBLE")) { return Types.DOUBLE; } else if (cubridType.equals("DATE")) { return Types.DATE; } else if (cubridType.equals("TIME")) { return Types.TIME; } else if (cubridType.equals("TIMESTAMP")) { return Types.TIMESTAMP; } else if (cubridType.equals("NULL")) { return Types.NULL; } else { return Types.OTHER; } } }