Removal of JDBC ODBC bridge in java 8

前端 未结 5 813
Happy的楠姐
Happy的楠姐 2020-11-22 15:42

Starting with Java 8, the JDBC-ODBC Bridge will no longer be included with the JDK.

Class.forName(\"sun.jdbc.odbc.JdbcOdbcDriver\"); // classNotFoundExceptio         


        
5条回答
  •  星月不相逢
    2020-11-22 16:14

    We can still use JDBC-ODBC Bridge in java 8 too, just follow this simple recipe:

    1. Download a JDK 7 or JRE 7.
    2. Goto JRE\lib folder and find the rt.jar
    3. Unzip it (if you have WinRAR or 7zip installed) or you can rename it to rt.zip and unzip it.
    4. Copy sun\jdbc and sun\security\action folders out, keep the folder structure. i.e., you should have the folder structure like below:

      Sun --> Security --> Action
          --> JDBC
      
    5. Open a CMD window. Go to the parent folder of Sun folder. Run the command: jar -cvf jdbc.jar sun

    6. The above command will create a file named jdbc.jar
    7. Copy JDBC.jar to your JDK8 or JRE8 lib folder. If that doesn't work try the lib\ext folder.
    8. Copy jdbcodbc.dll from JRE\bin of your JRE 7 installation to JRE\bin of your JRE 8 installation.
    9. Restart your JVM.

    How to enable JDBC-ODBC bridge for JDK 8

提交回复
热议问题