private void runInitFunctionIfRequired(String url,Connection connection) throws SQLException {
  Matcher matcher=INITFUNCTION_MATCHING_PATTERN.matcher(url);
  if (matcher.matches()) {
    String className=matcher.group(2);
    String methodName=matcher.group(4);
    try {
      Class<?> initFunctionClazz=Class.forName(className);
      Method method=initFunctionClazz.getMethod(methodName,Connection.class);
      method.invoke(null,connection);
    }
 catch (    ClassNotFoundException|NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
      LOGGER.error("Error while executing init function: {}::{}",className,methodName,e);
      throw new SQLException("Error while executing init function: " + className + "::"+ methodName,e);
    }
  }
}

private void runInitFunctionIfRequired ( String url , Connection connection ) throws SQLException { Matcher matcher = INITFUNCTION_MATCHING_PATTERN . matcher ( url ) ; if ( matcher . matches ( ) ) { String className = matcher . group ( 2 ) ; String methodName = matcher . group ( 4 ) ; try { Class < ? > initFunctionClazz = Class . forName ( className ) ; Method method = initFunctionClazz . getMethod ( methodName , Connection . class ) ; method . invoke ( null , connection ) ; } catch ( ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e ) { LOGGER . error ( "Error while executing init function: {}::{}" , className , methodName , e ) ; throw new SQLException ( "Error while executing init function: " + className + "::" + methodName , e ) ; } } }
run an init function ( must be a public static method on an accessible class ) .
