Java SQL Type getSQLParameterSubstring(String value, int type)

Here you can find the source of getSQLParameterSubstring(String value, int type)

Description

get SQL Parameter Substring

License

Open Source License

Declaration

public static String getSQLParameterSubstring(String value, int type) 

Method Source Code

//package com.java2s;

import java.sql.Types;

public class Main {
    public static String getSQLParameterSubstring(String value, int type) {

        if (isNumericType(type)) {
            return value;
        } else {//from   w w w. j ava2  s .c om
            return "'" + value + "'";
        }
    }

    public static boolean isNumericType(int type) {
        return Types.BIGINT == type || Types.DECIMAL == type || Types.INTEGER == type || Types.NUMERIC == type
                || Types.SMALLINT == type || Types.TINYINT == type;
    }
}

Related

  1. getSemestre(Integer actionformation_id, Connection connection, String actionformation_libellecourt)
  2. getSerialPrimaryKeyTypeString(Connection conn)
  3. getSimpleTypeString(String dbType)
  4. getSQLAttributeType(int sqlType)
  5. getSQLException(String message, String sqlState, Exception exception)
  6. getSqlType(int type)
  7. getSqlType(Object param)
  8. getSqlType(String cubridType)
  9. getSQLType(String text)