Example usage for java.sql Types FLOAT

List of usage examples for java.sql Types FLOAT

Introduction

In this page you can find the example usage for java.sql Types FLOAT.

Prototype

int FLOAT

To view the source code for java.sql Types FLOAT.

Click Source Link

Document

The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type FLOAT.

Usage

From source file:org.apache.ddlutils.platform.firebird.FirebirdModelReader.java

/**
* {@inheritDoc}/*from   w ww . j av a  2 s.  c  o  m*/
*/
protected Column readColumn(DatabaseMetaDataWrapper metaData, Map values) throws SQLException {
    Column column = super.readColumn(metaData, values);

    if (column.getTypeCode() == Types.FLOAT) {
        column.setTypeCode(Types.REAL);
    } else if (TypeMap.isTextType(column.getTypeCode())) {
        column.setDefaultValue(unescape(column.getDefaultValue(), "'", "''"));
    }
    return column;
}

From source file:org.apache.openjpa.jdbc.schema.Schemas.java

/**
 * Return the {@link Types} constant for the given SQL type name.
 *///w  w w  . ja v  a  2 s .  c  o m
public static int getJDBCType(String name) {
    if ("array".equalsIgnoreCase(name))
        return Types.ARRAY;
    if ("bigint".equalsIgnoreCase(name))
        return Types.BIGINT;
    if ("binary".equalsIgnoreCase(name))
        return Types.BINARY;
    if ("bit".equalsIgnoreCase(name))
        return Types.BIT;
    if ("blob".equalsIgnoreCase(name))
        return Types.BLOB;
    if ("char".equalsIgnoreCase(name))
        return Types.CHAR;
    if ("clob".equalsIgnoreCase(name))
        return Types.CLOB;
    if ("date".equalsIgnoreCase(name))
        return Types.DATE;
    if ("decimal".equalsIgnoreCase(name))
        return Types.DECIMAL;
    if ("distinct".equalsIgnoreCase(name))
        return Types.DISTINCT;
    if ("double".equalsIgnoreCase(name))
        return Types.DOUBLE;
    if ("float".equalsIgnoreCase(name))
        return Types.FLOAT;
    if ("integer".equalsIgnoreCase(name))
        return Types.INTEGER;
    if ("java_object".equalsIgnoreCase(name))
        return Types.JAVA_OBJECT;
    if ("longvarbinary".equalsIgnoreCase(name))
        return Types.LONGVARBINARY;
    if ("longvarchar".equalsIgnoreCase(name))
        return Types.LONGVARCHAR;
    if ("null".equalsIgnoreCase(name))
        return Types.NULL;
    if ("numeric".equalsIgnoreCase(name))
        return Types.NUMERIC;
    if ("other".equalsIgnoreCase(name))
        return Types.OTHER;
    if ("real".equalsIgnoreCase(name))
        return Types.REAL;
    if ("ref".equalsIgnoreCase(name))
        return Types.REF;
    if ("smallint".equalsIgnoreCase(name))
        return Types.SMALLINT;
    if ("struct".equalsIgnoreCase(name))
        return Types.STRUCT;
    if ("time".equalsIgnoreCase(name))
        return Types.TIME;
    if ("timestamp".equalsIgnoreCase(name))
        return Types.TIMESTAMP;
    if ("tinyint".equalsIgnoreCase(name))
        return Types.TINYINT;
    if ("varbinary".equalsIgnoreCase(name))
        return Types.VARBINARY;
    if ("varchar".equalsIgnoreCase(name))
        return Types.VARCHAR;
    if (name == null || name.toLowerCase().startsWith("unknown"))
        return Types.OTHER;
    throw new IllegalArgumentException("name = " + name);
}

From source file:org.georepublic.db.utils.ResultSetConverter.java

public static StringBuffer convertCsv(ResultSet rs) throws SQLException {

    String column_name = new String();
    StringBuffer retval = new StringBuffer();
    ResultSetMetaData rsmd = rs.getMetaData();
    int numColumns = rsmd.getColumnCount();

    for (int h = 1; h < numColumns + 1; h++) {
        column_name = rsmd.getColumnName(h);

        if (h > 1) {
            retval.append(",");
        }/*from   www  . ja v a 2s .co m*/

        retval.append(column_name);
    }
    retval.append("\n");

    while (rs.next()) {

        for (int i = 1; i < numColumns + 1; i++) {
            column_name = rsmd.getColumnName(i);

            if (StringUtils.equals(column_name, "the_geom")) {
                continue;
            }
            if (StringUtils.equals(column_name, "geojson")) {
                continue;
            }
            if (i > 1) {
                retval.append(",");
            }

            if (rsmd.getColumnType(i) == java.sql.Types.ARRAY) {
                retval.append(rs.getArray(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.BIGINT) {
                retval.append(rs.getInt(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.BOOLEAN) {
                retval.append(rs.getBoolean(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.BLOB) {
                retval.append(rs.getBlob(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.DOUBLE) {
                retval.append(rs.getDouble(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.FLOAT) {
                retval.append(rs.getFloat(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.INTEGER) {
                retval.append(rs.getInt(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.NVARCHAR) {
                retval.append(rs.getNString(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.VARCHAR) {
                retval.append(rs.getString(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.TINYINT) {
                retval.append(rs.getInt(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.SMALLINT) {
                retval.append(rs.getInt(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.DATE) {
                retval.append(rs.getDate(column_name));
            } else if (rsmd.getColumnType(i) == java.sql.Types.TIMESTAMP) {
                retval.append(rs.getTimestamp(column_name));
            } else {
                retval.append(rs.getObject(column_name));
            }

        }
        retval.append("\n");
    }

    return retval;
}

From source file:wzw.sql.ResultSetConverter.java

/**
 * ?// ww  w. j a v  a 2  s  . c  o m
 * @param rs
 * @param type Listjava.sql.Types 
 * @return
 * @throws SQLException
 */
public static List<Object> toTypeList(ResultSet rs, int type) throws SQLException {

    List<Object> list = new ArrayList<Object>();

    switch (type) {
    case Types.INTEGER:
        while (rs.next()) {
            list.add(new Integer(rs.getInt(1)));
        }

    case Types.BIGINT:
        while (rs.next()) {
            list.add(new Long(rs.getLong(1)));
        }

    case Types.VARCHAR:
        while (rs.next()) {
            list.add(rs.getString(1));
        }

    case Types.FLOAT:
        while (rs.next()) {
            list.add(new Float(rs.getFloat(1)));
        }

    case Types.DECIMAL:
    case Types.DOUBLE:
    case Types.NUMERIC:
        while (rs.next()) {
            list.add(new Double(rs.getDouble(1)));
        }

    case Types.TIMESTAMP:
        while (rs.next()) {
            list.add(rs.getTimestamp(1));
        }

    case Types.DATE:
        while (rs.next()) {
            list.add(rs.getDate(1));
        }

    case Types.TIME:
        while (rs.next()) {
            list.add(rs.getTime(1));
        }

        //default:
    }
    return list;
}

From source file:org.apache.ddlutils.platform.sybase.SybasePlatform.java

/**
 * Creates a new platform instance./*from   w ww .j  a  v a2 s .c  o  m*/
 */
public SybasePlatform() {
    PlatformInfo info = getPlatformInfo();

    info.setMaxIdentifierLength(28);
    info.setNullAsDefaultValueRequired(true);
    info.setIdentityColumnAutomaticallyRequired(true);
    info.setMultipleIdentityColumnsSupported(false);
    info.setPrimaryKeyColumnsHaveToBeRequired(true);
    info.setCommentPrefix("/*");
    info.setCommentSuffix("*/");

    info.addNativeTypeMapping(Types.ARRAY, "IMAGE");
    // BIGINT is mapped back in the model reader
    info.addNativeTypeMapping(Types.BIGINT, "DECIMAL(19,0)");
    // we're not using the native BIT type because it is rather limited (cannot be NULL, cannot be indexed)
    info.addNativeTypeMapping(Types.BIT, "SMALLINT", Types.SMALLINT);
    info.addNativeTypeMapping(Types.BLOB, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.BOOLEAN, "SMALLINT", Types.SMALLINT);
    info.addNativeTypeMapping(Types.CLOB, "TEXT", Types.LONGVARCHAR);
    info.addNativeTypeMapping(Types.DATALINK, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DATE, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.DISTINCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DOUBLE, "DOUBLE PRECISION");
    info.addNativeTypeMapping(Types.FLOAT, "DOUBLE PRECISION", Types.DOUBLE);
    info.addNativeTypeMapping(Types.INTEGER, "INT");
    info.addNativeTypeMapping(Types.JAVA_OBJECT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.LONGVARBINARY, "IMAGE");
    info.addNativeTypeMapping(Types.LONGVARCHAR, "TEXT");
    info.addNativeTypeMapping(Types.NULL, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.OTHER, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.REF, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.STRUCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.TIME, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.TIMESTAMP, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.TINYINT, "SMALLINT", Types.SMALLINT);

    info.setDefaultSize(Types.BINARY, 254);
    info.setDefaultSize(Types.VARBINARY, 254);
    info.setDefaultSize(Types.CHAR, 254);
    info.setDefaultSize(Types.VARCHAR, 254);

    setSqlBuilder(new SybaseBuilder(this));
    setModelReader(new SybaseModelReader(this));
}

From source file:com.btobits.automator.ant.sql.task.SQLCompareTask.java

private void verify() throws Exception {
    final LinkedList<SQLCompareTask.VerifyCell> rows = impl.getVerifySqls();
    for (final SQLCompareTask.VerifyCell sqlRow : rows) {
        sqlRow.validate();//from ww  w  .  jav a 2  s .  c  om

        switch (getColumnType(sqlRow)) {
        case Types.DOUBLE: {
            final Double val = (Double) getRowValue(sqlRow);

            if (val == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            }

            final DoubleValidator doubleValidator = new DoubleValidator();
            if (doubleValidator.isValid(sqlRow.getValue())) {
                final Double dbValue = doubleValidator.validate(sqlRow.getValue());
                if (!dbValue.equals(val)) {
                    errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                            + "], value [" + sqlRow.getValue() + " != " + val + "]");
                }
            } else {
                errors.add("Error cast field [" + sqlRow.toString() + "] to Double value.");
            }
        }
            break;

        case Types.FLOAT: {
            final Float val = (Float) getRowValue(sqlRow);

            if (val == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            }

            final FloatValidator validator = new FloatValidator();
            if (validator.isValid(sqlRow.getValue())) {
                final Float dbValue = validator.validate(sqlRow.getValue());
                if (!dbValue.equals(val)) {
                    errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                            + "], value [" + sqlRow.getValue() + " != " + val + "]");
                }
            } else {
                errors.add("Error cast field [" + sqlRow.toString() + "] to Float value.");
            }
        }
            break;

        case Types.DECIMAL: {
            final BigDecimal val = (BigDecimal) getRowValue(sqlRow);

            if (val == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            }

            final BigDecimalValidator validator = new BigDecimalValidator();
            if (validator.isValid(sqlRow.getValue())) {
                BigDecimal dbValue = validator.validate(sqlRow.getValue());
                dbValue = dbValue.setScale(val.scale());
                if (!dbValue.equals(val)) {
                    errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                            + "], value [" + sqlRow.getValue() + " != " + val + "]");
                }
            } else {
                errors.add("Error cast field [" + sqlRow.toString() + "] to Decimal value.");
            }
        }
            break;

        case Types.DATE: {
            final Date val = (Date) getDateRowValue(sqlRow);

            if (val == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            }

            final DateValidator validator = DateValidator.getInstance();
            if (validator.isValid(sqlRow.getValue(), "yyyy-MM-dd")) {
                final Date dbValue = validator.validate(sqlRow.getValue(), "yyyy-MM-dd");
                if (!dbValue.equals(val)) {
                    errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                            + "], value [" + sqlRow.getValue() + " != " + val + "]");
                }
            } else {
                errors.add("Error cast field [" + sqlRow.toString() + "] to Date value.");
            }
        }
            break;

        case Types.TIME: {
            final Date val = (Date) getTimeRowValue(sqlRow);
            if (val == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            }

            final TimeValidator validator = TimeValidator.getInstance();
            if (validator.isValid(sqlRow.getValue(), "HH:mm:ss")) {
                final Calendar dbValue = validator.validate(sqlRow.getValue(), "HH:mm:ss");
                final Calendar dbVal = Calendar.getInstance();
                dbVal.setTime(val);

                if (validator.compareHours(dbValue, dbVal) != 0 || validator.compareMinutes(dbValue, dbVal) != 0
                        || validator.compareSeconds(dbValue, dbVal) != 0) {
                    errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                            + "], value [" + sqlRow.getValue() + " != " + val + "]");
                }
            } else {
                errors.add("Error cast field [" + sqlRow.toString() + "] to Time value.");
            }
        }
            break;

        case Types.TIMESTAMP: {
            final Date val = getDateTimeRowValue(sqlRow);
            if (val == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            }

            final CalendarValidator validatorDate = CalendarValidator.getInstance();
            final TimeValidator validatorTime = TimeValidator.getInstance();
            if (validatorDate.isValid(sqlRow.getValue(), "yyyy-MM-dd HH:mm:ss")) {
                final Calendar dbValue = validatorDate.validate(sqlRow.getValue(), "yyyy-MM-dd HH:mm:ss");
                final Calendar dbVal = Calendar.getInstance();
                dbVal.setTimeInMillis(val.getTime());
                if (validatorDate.compareDates(dbVal, dbValue) != 0
                        || validatorTime.compareHours(dbValue, dbVal) != 0
                        || validatorTime.compareMinutes(dbValue, dbVal) != 0
                        || validatorTime.compareSeconds(dbValue, dbVal) != 0) {
                    errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                            + "], value [" + sqlRow.getValue() + " != " + val + "]");
                }
            } else {
                errors.add("Error cast field [" + sqlRow.toString() + "] to Timestamp value.");
            }
        }
            break;

        default: {
            final String dbValue = getStringRowValue(sqlRow);
            if (dbValue == null) {
                errors.add("Error compare row, row not exist [" + sqlRow.toString() + "].");
            } else if (!StringUtils.equals(sqlRow.getValue(), dbValue)) {
                errors.add("Error compare row [" + sqlRow.getRow() + "], field [" + sqlRow.getField()
                        + "], value [" + sqlRow.getValue() + " != " + dbValue + "]");
            }
        }
        }
    }
}

From source file:org.apache.tika.parser.jdbc.JDBCTableReader.java

private void handleCell(ResultSetMetaData rsmd, int i, ContentHandler handler, ParseContext context)
        throws SQLException, IOException, SAXException {
    switch (rsmd.getColumnType(i)) {
    case Types.BLOB:
        handleBlob(tableName, rsmd.getColumnName(i), rows, results, i, handler, context);
        break;// www.  java2 s.  co m
    case Types.CLOB:
        handleClob(tableName, rsmd.getColumnName(i), rows, results, i, handler, context);
        break;
    case Types.BOOLEAN:
        handleBoolean(results, i, handler);
        break;
    case Types.DATE:
        handleDate(results, i, handler);
        break;
    case Types.TIMESTAMP:
        handleTimeStamp(results, i, handler);
        break;
    case Types.INTEGER:
        handleInteger(results, i, handler);
        break;
    case Types.FLOAT:
        //this is necessary to handle rounding issues in presentation
        //Should we just use getString(i)?
        float f = results.getFloat(i);
        if (!results.wasNull()) {
            addAllCharacters(Float.toString(f), handler);
        }
        break;
    case Types.DOUBLE:
        double d = results.getDouble(i);
        if (!results.wasNull()) {
            addAllCharacters(Double.toString(d), handler);
        }
        break;
    default:
        String s = results.getString(i);
        if (!results.wasNull()) {
            addAllCharacters(s, handler);
        }
        break;
    }
}

From source file:org.apache.tajo.storage.jdbc.JdbcMetadataProviderBase.java

private TypeDesc convertDataType(ResultSet res) throws SQLException {
    final int typeId = res.getInt("DATA_TYPE");

    switch (typeId) {
    case Types.BOOLEAN:
        return new TypeDesc(newSimpleDataType(Type.BOOLEAN));

    case Types.TINYINT:
    case Types.SMALLINT:
    case Types.INTEGER:
        return new TypeDesc(newSimpleDataType(Type.INT4));

    case Types.DISTINCT: // sequence for postgresql
    case Types.BIGINT:
        return new TypeDesc(newSimpleDataType(Type.INT8));

    case Types.FLOAT:
        return new TypeDesc(newSimpleDataType(Type.FLOAT4));

    case Types.NUMERIC:
    case Types.DECIMAL:
    case Types.DOUBLE:
        return new TypeDesc(newSimpleDataType(Type.FLOAT8));

    case Types.DATE:
        return new TypeDesc(newSimpleDataType(Type.DATE));

    case Types.TIME:
        return new TypeDesc(newSimpleDataType(Type.TIME));

    case Types.TIMESTAMP:
        return new TypeDesc(newSimpleDataType(Type.TIMESTAMP));

    case Types.CHAR:
    case Types.NCHAR:
    case Types.VARCHAR:
    case Types.NVARCHAR:
    case Types.CLOB:
    case Types.NCLOB:
    case Types.LONGVARCHAR:
    case Types.LONGNVARCHAR:
        return new TypeDesc(newSimpleDataType(Type.TEXT));

    case Types.BINARY:
    case Types.VARBINARY:
    case Types.BLOB:
        return new TypeDesc(newSimpleDataType(Type.BLOB));

    default:/*from  ww  w  . j  av  a 2  s . co  m*/
        throw SQLExceptionUtil.toSQLException(new UnsupportedDataTypeException(typeId + ""));
    }
}

From source file:org.apache.ddlutils.platform.mssql.MSSqlPlatform.java

/**
 * Creates a new platform instance./*from  w ww.j  a  va 2s .c om*/
 */
public MSSqlPlatform() {
    PlatformInfo info = getPlatformInfo();

    info.setMaxIdentifierLength(128);
    info.setPrimaryKeyColumnAutomaticallyRequired(true);
    info.setIdentityColumnAutomaticallyRequired(true);
    info.setMultipleIdentityColumnsSupported(false);
    info.setSupportedOnUpdateActions(
            new CascadeActionEnum[] { CascadeActionEnum.CASCADE, CascadeActionEnum.NONE });
    info.addEquivalentOnUpdateActions(CascadeActionEnum.NONE, CascadeActionEnum.RESTRICT);
    info.setSupportedOnDeleteActions(
            new CascadeActionEnum[] { CascadeActionEnum.CASCADE, CascadeActionEnum.NONE });
    info.addEquivalentOnDeleteActions(CascadeActionEnum.NONE, CascadeActionEnum.RESTRICT);

    info.addNativeTypeMapping(Types.ARRAY, "IMAGE", Types.LONGVARBINARY);
    // BIGINT will be mapped back to BIGINT by the model reader 
    info.addNativeTypeMapping(Types.BIGINT, "DECIMAL(19,0)");
    info.addNativeTypeMapping(Types.BLOB, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.BOOLEAN, "BIT", Types.BIT);
    info.addNativeTypeMapping(Types.CLOB, "TEXT", Types.LONGVARCHAR);
    info.addNativeTypeMapping(Types.DATALINK, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DATE, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.DISTINCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DOUBLE, "FLOAT", Types.FLOAT);
    info.addNativeTypeMapping(Types.INTEGER, "INT");
    info.addNativeTypeMapping(Types.JAVA_OBJECT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.LONGVARBINARY, "IMAGE");
    info.addNativeTypeMapping(Types.LONGVARCHAR, "TEXT");
    info.addNativeTypeMapping(Types.NULL, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.OTHER, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.REF, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.STRUCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.TIME, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.TIMESTAMP, "DATETIME");
    info.addNativeTypeMapping(Types.TINYINT, "SMALLINT", Types.SMALLINT);

    info.setDefaultSize(Types.CHAR, 254);
    info.setDefaultSize(Types.VARCHAR, 254);
    info.setDefaultSize(Types.BINARY, 254);
    info.setDefaultSize(Types.VARBINARY, 254);

    setSqlBuilder(new MSSqlBuilder(this));
    setModelReader(new MSSqlModelReader(this));
}

From source file:org.apache.sqoop.manager.ConnManager.java

/**
 * Resolve a database-specific type to the Java type that should contain it.
 * @param sqlType     sql type//w w  w . j  a  v a2  s .com
 * @return the name of a Java type to hold the sql datatype, or null if none.
 */
public String toJavaType(int sqlType) {
    // Mappings taken from:
    // http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
    if (sqlType == Types.INTEGER) {
        return "Integer";
    } else if (sqlType == Types.VARCHAR) {
        return "String";
    } else if (sqlType == Types.CHAR) {
        return "String";
    } else if (sqlType == Types.LONGVARCHAR) {
        return "String";
    } else if (sqlType == Types.NVARCHAR) {
        return "String";
    } else if (sqlType == Types.NCHAR) {
        return "String";
    } else if (sqlType == Types.LONGNVARCHAR) {
        return "String";
    } else if (sqlType == Types.NUMERIC) {
        return "java.math.BigDecimal";
    } else if (sqlType == Types.DECIMAL) {
        return "java.math.BigDecimal";
    } else if (sqlType == Types.BIT) {
        return "Boolean";
    } else if (sqlType == Types.BOOLEAN) {
        return "Boolean";
    } else if (sqlType == Types.TINYINT) {
        return "Integer";
    } else if (sqlType == Types.SMALLINT) {
        return "Integer";
    } else if (sqlType == Types.BIGINT) {
        return "Long";
    } else if (sqlType == Types.REAL) {
        return "Float";
    } else if (sqlType == Types.FLOAT) {
        return "Double";
    } else if (sqlType == Types.DOUBLE) {
        return "Double";
    } else if (sqlType == Types.DATE) {
        return "java.sql.Date";
    } else if (sqlType == Types.TIME) {
        return "java.sql.Time";
    } else if (sqlType == Types.TIMESTAMP) {
        return "java.sql.Timestamp";
    } else if (sqlType == Types.BINARY || sqlType == Types.VARBINARY) {
        return BytesWritable.class.getName();
    } else if (sqlType == Types.CLOB) {
        return ClobRef.class.getName();
    } else if (sqlType == Types.BLOB || sqlType == Types.LONGVARBINARY) {
        return BlobRef.class.getName();
    } else {
        // TODO(aaron): Support DISTINCT, ARRAY, STRUCT, REF, JAVA_OBJECT.
        // Return null indicating database-specific manager should return a
        // java data type if it can find one for any nonstandard type.
        return null;
    }
}