7

I'm having some sort of problem with ucp.jar

If I use ucp.jar for oracle 12.1.0.1 it works.

If I use the version for oracle 12.1.0.2 then I get the following exception:

java.lang.ClassNotFoundException: oracle.jdbc.pooling.Factory

Is there anyone who can help me?

Thanks, Mauro

sorifiend
  • 5,927
  • 1
  • 28
  • 45
Mauro Scire'
  • 71
  • 1
  • 2

4 Answers4

2

The Jdbc (ojdbc7.jar) and UCP (ucp.jar) jars must always be from the same version (12.1.0.2). You can't upgrade one without upgrading the other. This version dependency was introduced in 12c. It wasn't the case before.

Jean de Lavarene
  • 3,461
  • 1
  • 20
  • 28
0

There is a ojdbc7.jar/ojdbc6.jar file dependency. You need to download/update either depending on the java version you are using.

zkarthik
  • 949
  • 1
  • 10
  • 18
0

Adding the following maven dependencies solved the issue for me

                <dependency>
                    <groupId>com.oracle.jdbc</groupId>
                    <artifactId>ojdbc7</artifactId>
                    <version>12.1.0.2</version>
                </dependency>
                <dependency>
                    <groupId>com.oracle.jdbc</groupId>
                    <artifactId>ucp</artifactId>
                    <version>12.1.0.2</version>
                </dependency>
adithya
  • 1,073
  • 2
  • 7
  • 10
0

(1) Register (or have an existing Oracle.com account)

(2) Go to http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html

Download ojdbc8.jar and udp.jar add to classpath.

(3) If you use build tools (Maven or Gralde), go to directory of files ojdbc8.jar and upd.jar

mvn install:install-file -Dfile=udp.jar -DgroupId=com.oracle -DartifactId=udp -Dversion=12.1.0.1 -Dpackaging=jar
mvn install:install-file -Dfile=ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.1.0.1 -Dpackaging=jar

(4) If you use Gradle, you must declare use MavenLocal in build.gradle. Example

plugins {
    id 'java'
}

group 'com.donhuvy'
version '1.0-SNAPSHOT'

sourceCompatibility = 10

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile('com.oracle:ojdbc8:12.1.0.1')
    compile('com.oracle:ucp:12.1.0.1')
    testCompile group: 'junit', name: 'junit', version: '4.12'
}
Vy Do
  • 46,709
  • 59
  • 215
  • 313