IllegalStateException: Cannot load driver class: oracle.jdbc.driver.OracleDriver code example

Example 1: IllegalStateException: Cannot load driver class: oracle.jdbc.driver.OracleDriver

<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 -->
<dependency>
    <groupId>com.oracle.database.jdbc</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.4</version>
</dependency>

Example 2: IllegalStateException: Cannot load driver class: oracle.jdbc.driver.OracleDriver

// https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6
compile group: 'com.oracle.database.jdbc', name: 'ojdbc6', version: '11.2.0.4'

Example 3: IllegalStateException: Cannot load driver class: oracle.jdbc.driver.OracleDriver

<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 -->
<dependency>
    <groupId>com.oracle.database.jdbc</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.4</version>
</dependency>

Tags:

Java Example