Here you can find the source of sqlType4Object(Object obj)
public static int sqlType4Object(Object obj) throws SQLException
//package com.java2s; /* Datamodel license.//from w ww. j av a2 s . c o m * Exclusive rights on this code in any form * are belong to it's author. This code was * developed for commercial purposes only. * For any questions and any actions with this * code in any form you have to contact to it's * author. * All rights reserved. */ import java.sql.*; public class Main { public static int sqlType4Object(Object obj) throws SQLException { if (obj instanceof String) { return Types.VARCHAR; } else if (obj instanceof java.math.BigDecimal) { return Types.NUMERIC; } else if (obj instanceof Boolean) { return Types.BOOLEAN; } else if (obj instanceof Integer) { return Types.INTEGER; } else if (obj instanceof Long) { return Types.BIGINT; } else if (obj instanceof Float) { return Types.REAL; } else if (obj instanceof Double) { return Types.DOUBLE; } else if (obj instanceof byte[]) { return Types.BINARY; } else if (obj instanceof java.sql.Date) { return Types.DATE; } else if (obj instanceof java.sql.Time) { return Types.TIME; } else if (obj instanceof java.sql.Timestamp) { return Types.TIMESTAMP; } else if (obj instanceof java.sql.Clob) { return Types.CLOB; } else if (obj instanceof Blob) { return Types.BLOB; } else if (obj instanceof java.sql.Array) { return Types.ARRAY; } else if (obj instanceof java.sql.Struct) { return Types.STRUCT; } else if (obj instanceof java.sql.Ref) { return Types.REF; } else { return Types.JAVA_OBJECT; } } }