Unable to obtain JDBC connection from datasource <p>I was trying to run the following command in gradle and it gave me the following error :</p> <pre><code> c:\gsoc\mifosx\mifosng-provider&gt;gradle migrateTenantListDB -PdbName=mifosplatfor m-tenants Listening for transport dt_socket at address: 8005 :migrateTenantListDB FAILED FAILURE: Build failed with an exception. * Where: Build file 'C:\gsoc\mifosx\mifosng-provider\build.gradle' line: 357 * What went wrong: Execution failed for task ':flywayMigrate'. &gt; Unable to obtain Jdbc connection from DataSource * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 13.843 secs </code></pre> <p>The script file is here and the line no. of error is shown as 357 but I dont know why it is showing me an error. Is it something about incorrect configuration in mysql server please help me out here: script:</p> <pre><code>task migrateTenantListDB&lt;&lt;{ description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)" def filePath = "filesystem:$projectDir" + System.properties['file.separator'] + '..' + System.properties['file.separator'] + 'mifosng-db' + System.properties['file.separator'] + 'migrations/list_db' def tenantsDbName = 'mifosplatform-tenants'; if (rootProject.hasProperty("dbName")) { tenantsDbName = rootProject.getProperty("dbName") } flyway.url= "jdbc:mysql://localhost:3306/$tenantsDbName" flyway.locations= [filePath] flywayMigrate.execute() } </code></pre>