@SuppressWarnings("unchecked")
    public static PreparedStatement createPreparedStatement(Connection conn, String sql, Object... parameters) throws SQLException {
        if (parameters == null) {
            return createByIterator(conn, sql, null);
        }

        if (parameters.length == 1) {
            Object value = parameters[0];
            Class<?> clazz = value.getClass();
            if (ClassUtils.isAssignable(clazz, Map.class)) {
                return createByMap(conn, sql, (Map<String, ?>) value);
            } else if (ClassUtils.isAssignable(clazz, Collection.class)) {
                return createByIterator(conn, sql, new ArrayIterator(parameters));
            } else if (clazz.isPrimitive() || clazz.getName().startsWith("java.")) {
                return createByIterator(conn, sql, new ArrayIterator(parameters));
            } else {
                Map<String, Object> beanMap = new BeanMap(value);
                return createByMap(conn, sql, beanMap);
            }
        } else {
            return createByIterator(conn, sql, new ArrayIterator(parameters));
        }
    }