Here you can find the source of convertSQLtype2JavaClassName(int type)
Parameter | Description |
---|---|
type | The java.sql.Types value to convert to a string representation. |
public static String convertSQLtype2JavaClassName(int type)
//package com.java2s; /*############################################################################## Copyright (C) 2011 HPCC Systems./*from www. j a v a 2 s . c o m*/ All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ############################################################################## */ import java.util.HashMap; public class Main { private final static HashMap<Integer, String> mapSQLtypeCodeToJavaClass = new HashMap<Integer, String>(); private final static String JAVA_OBJECT_TYPE_NAME = "java.lang.Object"; /** * Translates a data type from an integer (java.sql.Types value) to a string * that represents the corresponding class. * * @param type * The java.sql.Types value to convert to a string * representation. * @return The class name that corresponds to the given java.sql.Types * value, or "java.lang.Object" if the type has no known mapping. */ public static String convertSQLtype2JavaClassName(int type) { if (mapSQLtypeCodeToJavaClass.containsKey(type)) return mapSQLtypeCodeToJavaClass.get(type); else return JAVA_OBJECT_TYPE_NAME; } }