在 Java 8 中删除 JDBC ODBC 桥接器 [英] Removal of JDBC ODBC bridge in java 8

查看:25
本文介绍了在 Java 8 中删除 JDBC ODBC 桥接器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 Java 8 开始,JDBC-ODBC Bridge 将不再包含在 JDK 中.

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

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // classNotFoundException is thrown

是否有其他连接JDBC-ODBC Bridge的解决方案?

Is there any other solution connecting JDBC-ODBC Bridge?

推荐答案

我们仍然可以在 java 8 中使用 JDBC-ODBC Bridge,只需按照这个简单的方法:

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

  1. 下载 JDK 7 或 JRE 7.
  2. 转到 JRElib 文件夹并找到 rt.jar
  3. 解压(如果您安装了 WinRAR 或 7zip),或者您可以将其重命名为 rt.zip 并解压.
  4. 复制 sunjdbc 和 sunsecurityaction 文件夹,保持文件夹结构.即,您应该具有如下所示的文件夹结构:

  1. Download a JDK 7 or JRE 7.
  2. Goto JRElib 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 sunjdbc and sunsecurityaction folders out, keep the folder structure. i.e., you should have the folder structure like below:

Sun --> Security --> Action
    --> JDBC

  • 打开一个 CMD 窗口.转到 Sun 文件夹的父文件夹.运行命令:jar -cvf jdbc.jar sun

    如何为 JDK 8 启用 JDBC-ODBC 桥

    这篇关于在 Java 8 中删除 JDBC ODBC 桥接器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆