Java SQL Type getNameFromJdbcType(int jdbcType)

Here you can find the source of getNameFromJdbcType(int jdbcType)

Description

get Name From Jdbc Type

License

Apache License

Declaration

public static String getNameFromJdbcType(int jdbcType) 

Method Source Code


//package com.java2s;
/*/*w w  w .jav  a2s.  c o  m*/
 * Apache Derby is a subproject of the Apache DB project, and is licensed under
 * the Apache License, Version 2.0 (the "License"); you may not use these files
 * except in compliance with the License. You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * Splice Machine, Inc. has modified this file.
 *
 * All Splice Machine modifications are Copyright 2012 - 2016 Splice Machine, Inc.,
 * and are licensed to you under the License; you may not use this file except in
 * compliance with the License.
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 */

import java.sql.*;

public class Main {
    public static String getNameFromJdbcType(int jdbcType) {
        switch (jdbcType) {
        case Types.BIT:
            return "Types.BIT";
        case Types.BOOLEAN:
            return "Types.BOOLEAN";
        case Types.TINYINT:
            return "Types.TINYINT";
        case Types.SMALLINT:
            return "Types.SMALLINT";
        case Types.INTEGER:
            return "Types.INTEGER";
        case Types.BIGINT:
            return "Types.BIGINT";

        case Types.FLOAT:
            return "Types.FLOAT";
        case Types.REAL:
            return "Types.REAL";
        case Types.DOUBLE:
            return "Types.DOUBLE";

        case Types.NUMERIC:
            return "Types.NUMERIC";
        case Types.DECIMAL:
            return "Types.DECIMAL";

        case Types.CHAR:
            return "Types.CHAR";
        case Types.VARCHAR:
            return "Types.VARCHAR";
        case Types.LONGVARCHAR:
            return "Types.LONGVARCHAR";
        case Types.CLOB:
            return "Types.CLOB";

        case Types.DATE:
            return "Types.DATE";
        case Types.TIME:
            return "Types.TIME";
        case Types.TIMESTAMP:
            return "Types.TIMESTAMP";

        case Types.BINARY:
            return "Types.BINARY";
        case Types.VARBINARY:
            return "Types.VARBINARY";
        case Types.LONGVARBINARY:
            return "Types.LONGVARBINARY";
        case Types.BLOB:
            return "Types.BLOB";

        case Types.OTHER:
            return "Types.OTHER";
        case Types.NULL:
            return "Types.NULL";
        default:
            return String.valueOf(jdbcType);
        }
    }
}

Related

  1. getLong(Object object)
  2. getMBTileData(int column, int row, int zoomLevel, String jdbcConnectionString)
  3. getMBTileData(int column, int row, int zoomLevel, String jdbcConnectionString)
  4. getMessages(Array arr)
  5. getNameByType(int sqlType)
  6. getNextQuotes(String lastQuotes, int lastType)
  7. getNumberType(Integer precision, Integer scale)
  8. getNumTypeWidth(int type)
  9. getObject(int sqlType, String value)