public void source ( String resource , String username , String password , String dbName ) throws ManagedProcessException { InputStream from = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( resource ) ; if ( from == null ) throw new IllegalArgumentException ( "Could not find script file on the classpath at: " + resource ) ; run ( "script file sourced from the classpath at: " + resource , from , username , password , dbName ) ; }
Takes in a string that represents a resource on the classpath and sources it via the mysql command line tool .