1 2 Previous Next 17 Replies Latest reply: Apr 2, 2014 10:41 AM by rp0428 RSS

    JDK 1.7 JDBC driver for 11g

    user7048838

      I was looking at the following link to find out the JDBC driver for 11g, but couldn't find any for JDK 1.7. Is there any other location where I can find the driver or is it not yet supported?

      Oracle Database 11g Release 2 JDBC Driver Downloads</title><meta name="Title" content="Oracle Da…

        • 1. Re: JDK 1.7 JDBC driver for 11g
          rp0428

          It's on the Oracle 12 page - about halfway down the list of links - ojdbc7.jar

          http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html

          • 2. Re: JDK 1.7 JDBC driver for 11g
            user7048838

            Thanks for your response. But I am not using 12c database. I have 11g database and wanted to use JDK1.7 JDBC driver for the same without upgrading the DB.

            • 3. Re: JDK 1.7 JDBC driver for 11g
              rp0428
              Thanks for your response. But I am not using 12c database. I have 11g database and wanted to use JDK1.7 JDBC driver for the same without upgrading the DB.

              I don't know what that means 'use JDK1.7 JDBC driver for the same'.

               

              You said you wanted to download the JDBC driver that supports JDK1.7 and it is on that page I gave you the link to.

               

              What does that have to do with what DB version you wanted to use it with? The jar file is used for code executing external to the database.

               

              Oracle 11g database installation comes with both ojdbc5.jar and ojdbc6.jar but the version of Java loaded INTO the DB is version 1.5 and you can't upgrade it or modify it.

               

              Oracle 12g DB includes both ojdbc6.jar and ojdbc7.jar and is the first version of the DB to support multiple Java versions.

              Just for info if others are interested see the 'Multiple JDK Support' section of the Java Developer's Guide

              http://docs.oracle.com/cd/E16655_01/java.121/e17658/chone.htm#sthref96

              Starting from Oracle Database 12c Release 1 (12.1), Oracle JVM provides support for multiple JDK versions, including the latest JDK version. Typically, the supported versions are a default version and the next higher version. Oracle Database 12c Release 1 (12.1) supports JDK 6 and JDK 7, where JDK 6 is the default JDK version. So, if you do not set the JDK version explicitly, the JDK version in effect is JDK 6.

               

              At any given point of time, only one JDK version is in effect for the Database. You can switch from one JDK version to another depending on your needs.

              • 4. Re: JDK 1.7 JDBC driver for 11g
                user7048838

                What I mean is that I have a setup of 11g DB, external Java program using JDK1.6 and ojdbc6.jar. I am planning to upgrade my JDK to 1.7 for the external Java program, but couldn't find any corresponding driver for 11g DB. I saw that the link you provided lists ojdbc7.jar but that is listed under 12c DB drivers and am concerned about its compatibility with 11g DB.

                • 5. Re: JDK 1.7 JDBC driver for 11g
                  rp0428
                  What I mean is that I have a setup of 11g DB, external Java program using JDK1.6 and ojdbc6.jar. I am planning to upgrade my JDK to 1.7 for the external Java program, but couldn't find any corresponding driver for 11g DB. I saw that the link you provided lists ojdbc7.jar but that is listed under 12c DB drivers and am concerned about its compatibility with 11g DB.

                  You don't need to change the JDBC jar file. See the Oracle JDBC FAQ 'Which JDBC drivers support which versions of Oracle database'. The page hasn't been updated yet for the new driver.

                  http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html

                  • 6. Re: JDK 1.7 JDBC driver for 11g
                    user7048838

                    Thanks again for your response. The link actually confirms my concern that 11g JDBC drivers are not available for JDK 1.7, under "Which JDBC drivers support which versions of Javasoft's JDK?". But since it is an old page, I will need a confirmation, may be I think better to contact Oracle support for this.

                     

                    Even though as you suggested I can continue using the same drivers but there are some new features of JDBC introduced in JDK 1.7, that I need to make sure not to use.

                    • 7. Re: JDK 1.7 JDBC driver for 11g
                      gimbal2

                      Yes they are - Oracle drivers are backwards compatible so you can use the 12g drivers on Java 7 to connect to your 11g database, much like you can use OJDBC6 to connect to an old 10g database.

                      • 8. Re: JDK 1.7 JDBC driver for 11g
                        rp0428
                        The link actually confirms my concern that 11g JDBC drivers are not available for JDK 1.7

                        The FAQ I posted is what shows the database and JDK versions supported by the different drivers. As that page shows you can use a 'JDBC 9.2.0' driver to talk to an 11.2.0 database if you needed to for some reason.

                        But since it is an old page, I will need a confirmation, may be I think better to contact Oracle support for this.

                        By all means contact Oracle support. But perhaps you missed it when I said this:

                        The page hasn't been updated yet for the new driver.

                        The new driver was just released earlier this year and Oracle just hasn't updated that FAQ yet.

                        Even though as you suggested I can continue using the same drivers but there are some new features of JDBC introduced in JDK 1.7, that I need to make sure not to use.

                        The functionality to do that has been built into every Java compiler for many years now. Just use the 'source' and/or 'target' command-line parameters.

                        E:\>javac

                        Usage: javac <options> <source files>

                        where possible options include:

                        . . .

                          -source <release>          Provide source compatibility with specified release

                          -target <release>          Generate class files for specific VM version

                        That 'source' parameter will ensure that your source code is compatible with the release you specify.

                         

                        The 'target' parameter will ensure that the class files will be the proper version for the release you specify.

                        • 9. Re: JDK 1.7 JDBC driver for 11g
                          dsurber

                          Oracle JDBC drivers support all versions of the database that are supported at the time the driver is released. The 11g database was still supported when the 12c drivers were released so the 12c drivers support the 11g database. If you want to use JDK 7 you can either use the 11g ojdbc6.jar file which is supported with JDK 7 (see below), or you can use the 12c ojdbc7.jar file which supports 11g database. Oracle always recommends you use the most recent version of the driver so you should use 12c ojdbc7.jar.

                           

                          Going the other way, Oracle Database supports all versions of the JDBC drivers that are supported at the time the database is released. The 11g drivers were still supported when the 12c database was released so you can use the 11g drivers with the 12c database. Once again, Oracle always recommends you use the most recent version of the driver so while you can use 11g ojdbc6.jar with the 12c database Oracle recommends you use 12c ojdbc7.jar.

                           

                          Going across JDK versions is not always supported. Generally you cannot use ojdbcN.jar with JDK M if N > M. Oracle usually supports using ojdbcN.jar with JDK N+1, but not always. Mostly it has to do with when we get the resources to do the necessary testing. Oracle won't support a configuration we haven't tested. 11.2.0.3.0 ojdbc6.jar is supported with JDK 7. Frequently other combinations will work, they just aren't officially supported because they haven't been tested. If you have a problem with an unsupported combination we won't be able to help you.

                           

                          Douglas

                          • 10. Re: JDK 1.7 JDBC driver for 11g
                            Bill S

                            dsurber/Douglas's answer is very helpful.  Thank you. I keep asking this question myself about which driver I should use because the download page is confusing.  If someone looks at these three links and they are running Oracle Database 11.2.0.3 with an app in WebLogic 12 on Java 7, which driver do you think they are going to download?

                            • Oracle Database 12c Release 1 (12.1.0.1) drivers
                            • Oracle Database 11g Release 2 (11.2.0.4), (11.2.0.3), (11.2.0.2.0), (11.2.0.1.0) drivers
                            • Oracle Database 11g Release 1 (11.1.0.7), (11.1.0.6) drivers

                             

                            Most would chose the second one, but my understanding is that the first one is actually the recommended version.  If that is true, can the download page be updated to be more intuitive?  Here is a suggestion...

                            Oracle recommends using the latest driver compatible with your RDBMS and your program's java version:

                            • JDBC 12.1.1 (for RDBMS 12.1.1, 11.2.0 ...(?)...
                            • JDBC 11.2.0 (for RDBMS 11.2.0, 11.1,0, 10.2.0, 10.1.0, 9.2.0, 9.0.1)
                            • JDBC 11.1.0 (for RDBMS 11.2.0, 11.1,0, 10.2.0, 10.1.0, 9.2.0, 9.0.1)
                            • JDBC 10.2.0 (for RDBMS 11.2.0, 11.1,0, 10.2.0, 10.1.0, 9.2.0, 9.0.1, 8.1.7)

                            Bill

                            • 11. Re: JDK 1.7 JDBC driver for 11g
                              rp0428
                              If that is true, can the download page be updated to be more intuitive?

                              You would need to send any suggestions to Oracle. They are responsible for any and all web content. You may have noticed that the FAQ link I provided says it was last updated in 2009 which, as I mentioned earlier, explains why the new JDBC jar file isn't mentioned.

                              • 12. Re: JDK 1.7 JDBC driver for 11g
                                gimbal2

                                rp0428 wrote:

                                 

                                If that is true, can the download page be updated to be more intuitive?

                                You would need to send any suggestions to Oracle.

                                ... possibly in this sub-forum:

                                 

                                Downloads Issues

                                • 13. Re: JDK 1.7 JDBC driver for 11g
                                  dsurber

                                  If you know what Oracle marketing is writing, this is reasonably clear.

                                  • Oracle Database 12c Release 1 (12.1.0.1) drivers
                                  • Oracle Database 11g Release 2 (11.2.0.4), (11.2.0.3), (11.2.0.2.0), (11.2.0.1.0) drivers
                                  • Oracle Database 11g Release 1 (11.1.0.7), (11.1.0.6) drivers

                                  What you have to understand is that "Oracle Database 12c Release 1" is the full official Oracle version number that describes a particular release of the JDBC drivers. It is not saying "use these drivers with Database 12c". The drivers are part of the database release. They don't have any version number independent of the database. So Oracle describes the driver version as the database version which included the drivers. Since the drivers are always released as part of a database release this makes some sense.

                                   

                                  The numbers in parens are the database patch release numbers. They refer to a particular patch release level of the database version. Yes, this is probably meaningful only to Oracle marketing but they are responsible for how things are presented on OTN.

                                   

                                  I'll bring this to the attention of our Product Manager but I don't know if even he has much control over it.

                                  • 14. Re: JDK 1.7 JDBC driver for 11g
                                    5b0e379a-5a8b-4c89-a412-379fc3a2a9d6

                                    Hi dsurber

                                     

                                    Thanks a lot for all the information provided.

                                    But I am facing an issue over here since last 1 month, checked a lot forums, tried various alternatives, postponed the problem a lot times (due to other high priority tasks)

                                    & now this is on high priority. I seriously need your help, any sugessions are most welcome.

                                     

                                    Describing the problem...trying to connect to DB using oracle wallet from a java app..unix env..oracle installed - 11.2.0.4.

                                    I have tried the below jars for connectivity -

                                    1. Ojdbc6.jar (from Oracle Database 11g Release 2 JDBC Driver Downloads&lt;/title&gt;&lt;meta name=&quot;Title&quot; content=&quot;Oracle Da…)

                                    2. Ojdbc6.jar (from the one present in oracle installation folder - jdbc/lib)

                                    3. Ojdbc7.jar (from Oracle Database 12c Release 1 JDBC Driver Downloads)

                                     

                                    for 3 , getting the error :

                                    Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc12 in java.library.path

                                      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)

                                      at java.lang.Runtime.loadLibrary0(Runtime.java:845)

                                      at java.lang.System.loadLibrary(System.java:1084)

                                      at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:4091)

                                      at java.security.AccessController.doPrivileged(Native Method)

                                      at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:4087)

                                      at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:301)

                                      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:715)

                                      at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:195)

                                      at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:51)

                                      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:564)

                                      at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:303)

                                      at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:230)

                                      at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:175)

                                      at com.nordstrom.trickleEngine.cpp.dao.DataSource.getConnection(DataSource.java:247)

                                      at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:202)

                                      at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)

                                      at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)

                                      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)

                                      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

                                      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

                                      at $Proxy23.getLastJobExecution(Unknown Source)

                                      at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:85)

                                     

                                    for 1 & 2, getting the below error :

                                     

                                    Exception in thread "main" java.lang.UnsatisfiedLinkError: oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber()I

                                      at oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber(Native Method)

                                      at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3561)

                                      at java.security.AccessController.doPrivileged(Native Method)

                                      at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3556)

                                      at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:269)

                                      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)

                                      at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:165)

                                      at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)

                                      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)

                                      at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)

                                      at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207)

                                      at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:157)

                                      at com.nordstrom.trickleEngine.cpp.dao.DataSource.getConnection(DataSource.java:247)

                                      at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:202)

                                      at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)

                                      at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)

                                      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)

                                      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

                                      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

                                      at $Proxy23.getLastJobExecution(Unknown Source)

                                      at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:85)

                                     

                                    The interesting part is it is working 100% fine with 11.2.0.1.0 & corresponsing jar.

                                    1 2 Previous Next