public static Object invokeFunction(Object object, String functionName, Class[] parameters, Object[] values) throws MjdbcException {
        Object result = null;

        try {
            Method method = object.getClass().getMethod(functionName, parameters);
            method.setAccessible(true);
            result = method.invoke(object, values);
        } catch (Exception ex) {
            throw new MjdbcException(ex);
        }

        return result;
    }
public static Object invokeFunction ( Object object , String functionName , Class [ ] parameters , Object [ ] values ) throws MjdbcException { Object result = null ; try { Method method = object . getClass ( ) . getMethod ( functionName , parameters ) ; method . setAccessible ( true ) ; result = method . invoke ( object , values ) ; } catch ( Exception ex ) { throw new MjdbcException ( ex ) ; } return result ; }
Invokes class function using Reflection

@param object       Instance which function would be invoked
@param functionName function name
@param parameters   function parameters (array of Class)
@param values       function values (array of Object)
@return function return
@throws org.midao.jdbc.core.exception.MjdbcException in case function doesn't exists