Java SQL Date Check isDataTypeDate(int dataType)

Here you can find the source of isDataTypeDate(int dataType)

Description

Returns true if dataType is a valid date data type

License

Open Source License

Parameter

Parameter Description
dataType data type to check

Return

true/false

Declaration

public static boolean isDataTypeDate(int dataType) 

Method Source Code

//package com.java2s;
/*//  w  w  w  .  ja va 2  s  .  co m
 * Copyright (C) 2008 Michael Romankiewicz
 * microm at users.sourceforge.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

import java.sql.Types;

public class Main {
    /**
     * Returns true if dataType is a valid date data type
     * 
     * @param dataType
     *           data type to check
     * @return true/false
     */
    public static boolean isDataTypeDate(int dataType) {
        return dataType == Types.DATE || dataType == Types.TIMESTAMP
                || dataType == Types.TIME;
    }
}

Related

  1. isChunjie(String date)
  2. isDate(final PropertyDescriptor pd)
  3. isDate(int colType)
  4. isDate(int dataType)
  5. isDate(int dataType)