Java SQL Type getBIRTDataType(Integer datatype)

Here you can find the source of getBIRTDataType(Integer datatype)

Description

get BIRT Data Type

License

Open Source License

Declaration

static String getBIRTDataType(Integer datatype) 

Method Source Code


//package com.java2s;
/*/*from  w w  w .ja v a  2  s  .  co m*/
 *******************************************************************************
 * Copyright (c) 2009 Ing. Gerd Stockner (Mayr-Melnhof Karton Gesellschaft m.b.H.), Christian Voller (Mayr-Melnhof Karton Gesellschaft m.b.H.), CoSMIT GmbH
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Ing. Gerd Stockner (Mayr-Melnhof Karton Gesellschaft m.b.H.) - initial API and implementation
 *  Christian Voller (Mayr-Melnhof Karton Gesellschaft m.b.H.) - initial API and implementation
 *  CoSMIT GmbH - publishing, maintenance
 *******************************************************************************/

import java.sql.Types;

public class Main {
    static String getBIRTDataType(Integer datatype) {
        switch (datatype) {
        case Types.BOOLEAN:
            return "boolean";

        case Types.DATE:
            return "date-time";

        case Types.DECIMAL:
            return "decimal";

        case Types.DOUBLE:
            return "decimal";

        case Types.FLOAT:
            return "float";

        case Types.INTEGER:
            return "integer";

        case Types.NUMERIC:
            return "float";

        case Types.TIME:
            return "time";

        case Types.TIMESTAMP:
            return "date-time";

        case Types.VARCHAR:
            return "string";

        default:
            return "string";
        }

    }
}

Related

  1. getAntipodeForFunction(String base, int destType)
  2. getArgTypes()
  3. getAsciiStream(Object value, int columnType)
  4. getBinary(Object value, int columnType)
  5. getBinaryStream(Object value, int columnType)
  6. getCallableStatementValue(CallableStatement cstm, int index)
  7. getCastExpression(Class aClass)
  8. getCharStream(Object value, int columnType)
  9. getClass(int sqlType, int precision, int scale)