Replacement for JDBC-ODBC Bridge

ぐ巨炮叔叔 提交于 2019-12-10 13:45:39

问题


In Java 8 the JDBC-ODBC-Bridge will be removed. The typical error is:

java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver

Do you know of a possible replacement? I found Easysoft. But this bridge required an additional server which not run inside the Java VM. It is a type 3 driver and not a type 1 driver. Are there other alternatives?


回答1:


Another solution is to take the ODBC stuff from the 1.7 JRE and package it up into it's own JAR file.

To do so (this is for Windows 64 but the process should be the same), you'll need to grab the JdbcOdbc.dll out of the 1.7 JRE bin and copy it into the 1.8 JRE bin.

Next, extract the contents of the 1.7 JRE's lib\rt.jar into another location. Once extracted, delete everything except

sun\
    jdbc\
        odbc\
            *
    security\
        action\
            LoadLibraryAction.class 

Then create a JAR file with the remaining contents (the root contents of the JAR should be META-INF and sun). Copy the JAR file into the 1.8 JRE's lib\ext folder.




回答2:


In the meantime we have written our own JDBC-ODBC-Bridge based on JNA for our reporting software i-net Clear-Reports. Currently the driver is not an official product. But if you have interest then you can contact us.



来源:https://stackoverflow.com/questions/13358217/replacement-for-jdbc-odbc-bridge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!