How to add OJDBC6.jar in build.gradle file?

2019-02-23 21:41发布

问题:

I am connecting to Oracle Db in my application and trying to build the app with gradle build. I am unable to access the OJDBC6.jar from gradle build. can some one please, let me know that, how can we add the ojdbc6.jar into the build.gradle file.

回答1:

You should be able to load your OJDBC dependency as a runtime requirement as follows:

dependencies {
    runtime files('path/to/OJDBC6.jar')
}