Java SQL Type getOdaTypeName(int odaTypeCode)

Here you can find the source of getOdaTypeName(int odaTypeCode)

Description

Returns oda type name

License

Apache License

Parameter

Parameter Description
odaTypeCode a parameter

Declaration

public static String getOdaTypeName(int odaTypeCode) 

Method Source Code

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

import java.sql.Types;

public class Main {
    /**/*from w  ww.  ja  v  a 2  s  .c o  m*/
     * Returns oda type name
     * 
     * @param odaTypeCode
     * @return
     */
    public static String getOdaTypeName(int odaTypeCode) {
        switch (odaTypeCode) {
        case Types.INTEGER:
            return "INT"; //$NON-NLS-1$
        case Types.DOUBLE:
        case Types.FLOAT:
            return "DOUBLE"; //$NON-NLS-1$
        case Types.VARCHAR:
            return "STRING"; //$NON-NLS-1$
        case Types.DATE:
            return "DATE"; //$NON-NLS-1$
        case Types.TIME:
            return "TIME"; //$NON-NLS-1$
        case Types.TIMESTAMP:
            return "TIMESTAMP"; //$NON-NLS-1$
        case Types.NUMERIC:
        case Types.DECIMAL:
            return "BIGDECIMAL"; //$NON-NLS-1$
        case Types.BLOB:
            return "BLOB"; //$NON-NLS-1$
        case Types.CLOB:
            return "CLOB"; //$NON-NLS-1$
        case Types.BOOLEAN:
            return "BOOLEAN"; //$NON-NLS-1$
        default:
            return "STRING"; //$NON-NLS-1$
        }
    }
}

Related

  1. getNumberType(Integer precision, Integer scale)
  2. getNumTypeWidth(int type)
  3. getObject(int sqlType, String value)
  4. getObjectType(Object param)
  5. getObjectType(Object param)
  6. getParamArray(String signature, int numParam, boolean returnAllParams)
  7. getPartitionSizeValidationError(int colType, String column, String partitionSize)
  8. getPreferredHibernateType(int sqlType, int size, int precision, int scale, boolean nullable, boolean generatedIdentifier)
  9. getPreparedStatementSetMethodMap()