Here you can find the source of getSQLTypeByName(String type)
Parameter | Description |
---|---|
type | sql type name |
public static int getSQLTypeByName(String type)
//package com.java2s; /************************************************************************************** * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ import java.util.Map; public class Main { private static Map<String, Integer> sqlTypeMap; /**/*from ww w .j a va 2s . co m*/ * Returns the SQL type by type name. * @param type sql type name * @return type sql type */ public static int getSQLTypeByName(String type) { Integer val = sqlTypeMap.get(type.toUpperCase()); if (val != null) { return val; } throw new RuntimeException("Type by name '" + type + "' is not a recognized java.sql.Types type"); } }