-2

here is build.gradle **dependencies
{

compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile files('libs/mysql-connector-java-5.1.15-bin.jar')

}**

2 Answers2

0

Follow this steps in Android Studio project structure

mysql-connector-java-5.1.15-bin.jar this jar file drag and drop to project structure in app/libs/mysql-connector-java-5.1.15-bin.jar Then right click on that jar file and select Add as Library after that go to app build.gradle and Sync it. Now it should be work well .you can import any class of JDBC, ...,.....library

0

Try adding the .jar file into the libs folder in app folder.