# Classpath problem using SQL in Gradle Task

**URL:** <https://discuss.gradle.org/t/classpath-problem-using-sql-in-gradle-task/27910>\
**Category:** Help/Discuss\
**Created:** [July 25, 2018, 8:17pm UTC](https://discuss.gradle.org/t/classpath-problem-using-sql-in-gradle-task/27910 "2018-07-25T20:17:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyleocit](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kyleocit](https://discuss.gradle.org/u/kyleocit)\
**Post date:** [July 25, 2018, 8:17pm UTC](https://discuss.gradle.org/t/classpath-problem-using-sql-in-gradle-task/27910/1 "2018-07-25T20:17:42Z")

</div>

I have a script called ‘utilities.gradle’ that I include at the end of my build.gradle file using:  
apply from: ‘utilities.gradle’

When executing the utilties.wipe task I’m getting:  
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test?allowMultiQueries=true

> **utilities.gradle**
>
> ```
> buildscript {
> repositories {
> mavenCentral()
> }
> 
> dependencies {
> classpath 'mysql:mysql-connector-java:5.1.35'
> }
> }
> 
> import groovy.sql.Sql
> import com.mysql.jdbc.Driver
> 
> task wipe {
> group 'Utilities'
> description 'Deletes all record data from the development database'
> 	
> doLast {
> def url = 'jdbc:mysql://localhost:3306/test?allowMultiQueries=true'
> def user = 'test'
> def password = 'password'
> def driver = 'com.mysql.jdbc.Driver'
> 		
> Class.forName(driver)
> 		
> print 'wiping local database... '
> Sql.withInstance(url, user, password, driver) { sql ->
> sql.execute '''
> delete from test_data;
> delete from test_data2;
> '''
> }
> println 'done!'
> 		
> println 'wipe completed successfully'
> }
> }
> 
> ```

Any insight into what I’m doing wrong is greatly appreciated!

Edit: I am using Gradle 4.8.1.
