Java SQL Type getCastExpression(Class aClass)

Here you can find the source of getCastExpression(Class aClass)

Description

get Cast Expression

License

Open Source License

Declaration

static public String getCastExpression(Class aClass) 

Method Source Code

//package com.java2s;
/*/*from www  .j  a  v a2  s .  c  o  m*/
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2011-2012, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 */

import java.sql.Blob;

import java.sql.Clob;

import java.util.Map;

public class Main {
    private static Map<Class, String> CAST_EPXPRESSIONS = null;

    static public String getCastExpression(Class aClass) {
        if (Clob.class.isAssignableFrom(aClass))
            return "CAST (? as CLOB(1G))";
        if (Blob.class.isAssignableFrom(aClass))
            return "CAST (? as BLOB(2G))";
        return CAST_EPXPRESSIONS.get(aClass);
    }
}

Related

  1. getAsciiStream(Object value, int columnType)
  2. getBinary(Object value, int columnType)
  3. getBinaryStream(Object value, int columnType)
  4. getBIRTDataType(Integer datatype)
  5. getCallableStatementValue(CallableStatement cstm, int index)
  6. getCharStream(Object value, int columnType)
  7. getClass(int sqlType, int precision, int scale)
  8. getClassByJdbcType(int type, int decimalDigits)
  9. getCloverTypeFromJdbcType(int jdbcDataType)