Java SQL Type sqlTypeIsNumeric(int sqlType)

Here you can find the source of sqlTypeIsNumeric(int sqlType)

Description

sql Type Is Numeric

License

Open Source License

Declaration

public static boolean sqlTypeIsNumeric(int sqlType) 

Method Source Code

//package com.java2s;
/* ***** BEGIN LICENSE BLOCK *****
 *
 * This file is part of Weave./* ww w . j a  va2  s .  com*/
 *
 * The Initial Developer of Weave is the Institute for Visualization
 * and Perception Research at the University of Massachusetts Lowell.
 * Portions created by the Initial Developer are Copyright (C) 2008-2015
 * the Initial Developer. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * ***** END LICENSE BLOCK ***** */

import java.sql.Types;

public class Main {
    public static boolean sqlTypeIsNumeric(int sqlType) {
        switch (sqlType) {
        case Types.TINYINT:
        case Types.SMALLINT:
        case Types.BIGINT:
        case Types.DECIMAL:
        case Types.INTEGER:
        case Types.FLOAT:
        case Types.DOUBLE:
        case Types.REAL:
        case Types.NUMERIC:
            /* case Types.ROWID: // produces compiler error in some environments */
            return true;
        default:
            return false;
        }
    }
}

Related

  1. setFieldValue(Object oBean, String sFieldName, Object oValue)
  2. setProperty(Object object, String name, String value)
  3. sqlType2Name(int sqlType)
  4. sqlType4Object(Object obj)
  5. sqlTypeFromString(String sqlType)
  6. sqlTypeName(final int value)
  7. sqlTypeString(int sqlType)
  8. sqlTypeToClass(int sqlType, String className)
  9. sqlTypeToClassType(final Integer sqlType)